:root {
  --bg: #eff3fb;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --line: rgba(13, 34, 64, 0.12);
  --text: #11233a;
  --muted: #64748b;
  --brand: #ff7a18;
  --brand-deep: #ff5a1f;
  --accent: #1b84ff;
  --accent-soft: rgba(27, 132, 255, 0.12);
  --danger: #d9475c;
  --shadow-lg: 0 24px 60px rgba(17, 39, 69, 0.12);
  --shadow-sm: 0 10px 24px rgba(17, 39, 69, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(27, 132, 255, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 122, 24, 0.16), transparent 24%),
    linear-gradient(180deg, #fef8f1 0%, #f4f8fe 44%, #edf2fa 100%);
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-shell {
  width: min(calc(100% - 2rem), 1380px);
  margin-inline: auto;
  padding: 1rem 0 3rem;
}

.admin-header,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.admin-header {
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--brand-deep);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-header h1,
.panel-heading h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.admin-header h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 0.98;
}

.header-copy,
.panel-note,
.inventory-card p {
  color: var(--muted);
  line-height: 1.7;
}

.admin-header-actions,
.panel-heading,
.inventory-controls,
.form-grid,
.summary-grid,
.form-actions {
  display: flex;
}

.admin-header-actions {
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-layout {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  gap: 1rem;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 1.3rem;
}

.summary-panel {
  grid-column: 1 / -1;
}

.summary-grid {
  gap: 1rem;
  flex-wrap: wrap;
}

.summary-card {
  min-width: 180px;
  flex: 1 1 180px;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.92));
  border: 1px solid rgba(13, 34, 64, 0.08);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.summary-card strong {
  display: block;
  margin-top: 0.5rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
}

.panel-note {
  margin: 1rem 0 0;
}

.editor-panel {
  align-self: start;
}

.panel-heading {
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ghost-button,
.primary-button {
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  font-weight: 700;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.primary-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.product-form {
  display: grid;
  gap: 0.95rem;
}

.product-form label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.product-form input,
.product-form textarea,
.product-form select,
.inventory-search {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(248, 250, 255, 0.92);
  color: var(--text);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  outline: none;
}

.product-form textarea {
  resize: vertical;
  min-height: 120px;
}

.product-form input:focus,
.product-form textarea:focus,
.product-form select:focus,
.inventory-search:focus {
  border-color: rgba(27, 132, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(27, 132, 255, 0.12);
}

.form-grid {
  gap: 0.9rem;
}

.two-up > * {
  flex: 1 1 0;
}

.three-up > * {
  flex: 1 1 0;
}

.image-preview-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(245, 248, 255, 0.9);
  border: 1px solid var(--line);
}

.image-preview-card span {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

.image-preview-card img {
  width: 100%;
  max-height: 220px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(13, 34, 64, 0.08);
}

.form-actions {
  gap: 0.8rem;
  flex-wrap: wrap;
}

.inventory-controls {
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.inventory-panel {
  display: grid;
  gap: 1rem;
}

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

.inventory-card {
  border: 1px solid rgba(13, 34, 64, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.inventory-media {
  height: 210px;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.96), rgba(232, 240, 255, 0.85));
  display: grid;
  place-items: center;
}

.inventory-media img {
  width: min(100%, 220px);
  max-height: 180px;
  object-fit: contain;
}

.inventory-body {
  padding: 1rem;
}

.inventory-top,
.inventory-meta,
.inventory-actions {
  display: flex;
}

.inventory-top {
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.inventory-top h3 {
  margin: 0;
  font-size: 1.08rem;
}

.inventory-badges,
.inventory-meta {
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.badge.category {
  background: rgba(27, 132, 255, 0.12);
  color: var(--accent);
}

.badge.featured {
  background: rgba(255, 122, 24, 0.14);
  color: var(--brand-deep);
}

.badge.stock {
  background: rgba(24, 169, 87, 0.12);
  color: #0c7c3a;
}

.inventory-meta {
  margin: 0.9rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.inventory-actions {
  gap: 0.7rem;
  margin-top: 1rem;
}

.inventory-actions button {
  flex: 1 1 0;
}

.danger-button {
  border: 1px solid rgba(217, 71, 92, 0.24);
  background: rgba(217, 71, 92, 0.1);
  color: var(--danger);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line);
  color: var(--muted);
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .admin-shell {
    width: min(calc(100% - 1rem), 1380px);
  }

  .admin-header,
  .panel-heading,
  .inventory-controls,
  .form-grid,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-header {
    padding: 1.2rem;
  }

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

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