:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-2: #eef4f0;
  --ink: #1c2320;
  --muted: #66736d;
  --line: #d8ded7;
  --teal: #0f766e;
  --teal-dark: #0c514d;
  --berry: #a93655;
  --amber: #b7791f;
  --shadow: 0 18px 48px rgba(41, 54, 45, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
  min-width: 0;
}

button {
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(244, 246, 241, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav-tab {
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.nav-tab.active {
  background: var(--teal);
  color: #fff;
}

.user-chip {
  justify-self: end;
  min-width: 108px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  color: var(--teal-dark);
  font-weight: 700;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 48px;
}

.hero {
  position: relative;
  min-height: min(620px, calc(100vh - 88px));
  display: grid;
  align-items: end;
  margin: 18px 0 18px;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
  scroll-margin-top: 96px;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) brightness(0.82);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 19, 17, 0.82), rgba(12, 19, 17, 0.32) 58%, rgba(12, 19, 17, 0.08));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: clamp(28px, 7vw, 72px);
  color: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--berry);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #f4c27a;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
}

.hero-copy {
  width: min(520px, 100%);
  margin-bottom: 26px;
  font-size: 18px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
}

.hero-actions,
.toolbar,
.panel-head,
.section-head,
.cart-total {
  display: flex;
  align-items: center;
}

.hero-actions,
.toolbar {
  gap: 10px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 15px;
  font-weight: 800;
}

.primary-action {
  background: var(--teal);
  color: #fff;
}

.primary-action:hover {
  background: var(--teal-dark);
}

.secondary-action {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.full {
  width: 100%;
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stats-band > div {
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(41, 54, 45, 0.06);
}

.stats-band span {
  display: block;
  font-size: 30px;
  font-weight: 850;
}

.stats-band small {
  color: var(--muted);
}

.view {
  display: none;
  margin-top: 22px;
  scroll-margin-top: 96px;
}

.view.active {
  display: block;
}

.section-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select,
.inline-form input,
.inline-form select,
.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.product-card,
.cart-panel,
.login-panel,
.admin-panel,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(41, 54, 45, 0.08);
}

.product-card {
  overflow: hidden;
}

.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
}

.product-body {
  padding: 14px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 12px;
  color: var(--muted);
}

.price {
  color: var(--berry);
  font-size: 20px;
  font-weight: 850;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f4eadf;
  color: #7c4f15;
  font-size: 12px;
  font-weight: 700;
}

.cart-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  padding: 16px;
}

.panel-head,
.cart-total {
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cart-list {
  display: grid;
  gap: 10px;
  min-height: 116px;
  padding: 14px 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 10px;
  align-items: center;
}

.cart-item img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
}

.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  color: var(--berry);
}

.cart-total {
  padding: 12px 0 14px;
  border-top: 1px solid var(--line);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: var(--surface-2);
}

.status {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e9f5f2;
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
}

.login-panel,
.admin-panel {
  padding: 16px;
}

.admin-panel.wide {
  grid-row: span 2;
}

.login-form,
.inline-form {
  display: grid;
  gap: 12px;
}

.login-form label,
.inline-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inline-form {
  grid-template-columns: 1fr 150px 110px 100px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.form-wide {
  grid-column: 1 / -2;
}

.login-status {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-list,
.fashion-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-row,
.fashion-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-row {
  grid-template-columns: 72px 1fr auto;
  align-items: center;
}

.admin-row img,
.fashion-card img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  font-weight: 800;
}

.danger {
  color: var(--berry);
}

.empty {
  color: var(--muted);
  line-height: 1.7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

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

  .user-chip {
    justify-self: stretch;
  }

  .nav-tabs {
    overflow-x: auto;
  }

  .catalog-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }

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

@media (max-width: 640px) {
  main {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    padding: 12px;
  }

  .hero {
    min-height: 520px;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(12, 19, 17, 0.3), rgba(12, 19, 17, 0.86));
  }

  .hero-content {
    padding: 24px;
  }

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

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .inline-form {
    grid-template-columns: 1fr;
  }

  .form-wide {
    grid-column: auto;
  }

  .admin-row {
    grid-template-columns: 64px 1fr;
  }

  .admin-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .mini-button {
    flex: 1;
  }
}
