@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --bg: #f7f1e7;
  --bg-accent: #f4dfbe;
  --panel: rgba(255, 250, 242, 0.9);
  --panel-strong: rgba(255, 247, 235, 0.98);
  --line: rgba(84, 55, 23, 0.14);
  --text: #1f140c;
  --muted: #6f5a47;
  --brand: #bf5a1d;
  --brand-strong: #8f3f11;
  --brand-soft: rgba(191, 90, 29, 0.12);
  --success: #2f6e45;
  --success-soft: rgba(47, 110, 69, 0.12);
  --danger: #9a2f2f;
  --danger-soft: rgba(154, 47, 47, 0.12);
  --shadow: 0 24px 70px rgba(82, 53, 19, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 215, 169, 0.7), transparent 36%),
    radial-gradient(circle at top right, rgba(242, 198, 129, 0.45), transparent 30%),
    linear-gradient(180deg, #fff7ee 0%, #f7f1e7 58%, #efe0c5 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 80, 45, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 80, 45, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.85), transparent 90%);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  position: relative;
  padding: 36px 20px 28px;
  max-width: 1540px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 18px;
  margin-bottom: 22px;
}

.hero-copy,
.hero-stats,
.panel,
.footer {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.98), rgba(249, 236, 217, 0.94)),
    linear-gradient(45deg, rgba(191, 90, 29, 0.08), transparent 50%);
}

.hero-copy h1 {
  margin: 10px 0 14px;
  max-width: 12ch;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 56ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  gap: 16px;
  align-content: stretch;
}

.stat-card {
  display: grid;
  gap: 8px;
  padding: 24px;
  min-height: 140px;
  background:
    linear-gradient(160deg, rgba(255, 248, 237, 0.98), rgba(242, 226, 204, 0.82));
  border-radius: var(--radius-xl);
}

.stat-card strong {
  font-size: 1.1rem;
}

.stat-card span {
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
}

.eyebrow-muted {
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
}

.panel {
  background: var(--panel);
}

.panel-form {
  padding: 24px;
}

.panel-list {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin: 8px 0 0;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.toolbar,
.list-toolbar,
.image-actions,
.product-actions,
.pagination,
.footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar,
.list-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  color: #fff7f1;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 16px 28px rgba(191, 90, 29, 0.25);
}

.secondary-button {
  background: #fff6e6;
  color: var(--brand-strong);
  border-color: rgba(191, 90, 29, 0.22);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
  color: var(--text);
}

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

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.product-form {
  display: grid;
  gap: 22px;
}

.form-section {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.section-heading h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

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

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-size: 0.96rem;
}

.field-required {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.field-control {
  width: 100%;
  border: 1px solid rgba(101, 68, 38, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 14px 15px;
  min-height: 52px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field-control:focus {
  border-color: rgba(191, 90, 29, 0.5);
  box-shadow: 0 0 0 4px rgba(191, 90, 29, 0.12);
}

.field-control-textarea {
  resize: vertical;
  min-height: 120px;
}

.field-help {
  color: var(--muted);
  line-height: 1.5;
}

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

.toggle-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.76);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  font-weight: 600;
}

.image-grid {
  display: grid;
  gap: 14px;
}

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

.image-grid-secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.image-field {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.upload-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 184px;
  border-radius: 18px;
  border: 1px dashed rgba(191, 90, 29, 0.35);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.9), rgba(246, 232, 210, 0.8));
  overflow: hidden;
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-placeholder {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

.image-meta {
  display: grid;
  gap: 4px;
}

.image-actions {
  justify-content: space-between;
}

.image-caption {
  color: var(--muted);
  font-size: 0.9rem;
}

.alert {
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 600;
}

.alert-success {
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(47, 110, 69, 0.2);
}

.alert-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(154, 47, 47, 0.18);
}

.search-input {
  min-width: 280px;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  padding: 0 18px;
}

.product-list {
  display: grid;
  gap: 14px;
}

.product-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.product-card-top {
  display: flex;
  gap: 14px;
}

.product-thumb {
  width: 94px;
  height: 94px;
  flex: 0 0 94px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(116, 72, 29, 0.1);
  background: #fff8f0;
}

.product-thumb-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.product-copy h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
}

.product-meta,
.product-description,
.pagination-copy,
.footer span {
  color: var(--muted);
}

.product-meta,
.product-description {
  margin: 0;
  line-height: 1.5;
}

.product-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.product-facts span {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.product-actions {
  justify-content: flex-end;
}

.empty-state {
  padding: 36px 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(101, 68, 38, 0.2);
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.54);
}

.pagination {
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.footer {
  margin-top: 22px;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(255, 248, 236, 0.96), rgba(247, 230, 206, 0.92));
}

@media (max-width: 1120px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .image-grid-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    padding-inline: 14px;
  }

  .hero-copy,
  .panel-form,
  .panel-list,
  .footer {
    padding: 18px;
  }

  .panel-heading,
  .toolbar,
  .list-toolbar,
  .product-card-top,
  .footer,
  .pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .field-grid,
  .toggle-row,
  .image-grid-primary,
  .image-grid-secondary {
    grid-template-columns: 1fr;
  }

  .search-input {
    min-width: 0;
    width: 100%;
  }
}
