:root {
  --bg: #fef6e7;
  --bg-soft: #fff8ef;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(116, 82, 43, 0.12);
  --text: #3d2c1e;
  --muted: #7a6756;
  --primary: #eb6f2d;
  --primary-dark: #c8561d;
  --secondary: #167c78;
  --secondary-dark: #105d5a;
  --accent: #ffd166;
  --danger: #cf4b4b;
  --shadow: 0 24px 55px rgba(116, 82, 43, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Work Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.45), transparent 28%),
    radial-gradient(circle at top right, rgba(22, 124, 120, 0.2), transparent 24%),
    linear-gradient(180deg, #fff4db 0%, #ffe9d1 36%, #fef6e7 100%);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  align-items: stretch;
  margin-bottom: 28px;
}

.hero__content,
.hero__stats,
.panel,
.modal__dialog {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero__content {
  border-radius: var(--radius-lg);
  padding: 32px;
}

.hero__content h1,
.panel h2,
.panel h3,
.modal__dialog h3 {
  font-family: "Baloo 2", cursive;
  margin: 0;
  letter-spacing: -0.02em;
}

.hero__content h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.95;
  margin-top: 8px;
}

.hero__content p {
  font-size: 1.05rem;
  max-width: 620px;
  color: var(--muted);
  margin: 16px 0 0;
}

.eyebrow,
.panel__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary);
}

.hero__stats {
  border-radius: var(--radius-lg);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.stat-card {
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 239, 0.88));
  border: 1px solid rgba(116, 82, 43, 0.08);
}

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

.stat-card strong {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  margin-top: 8px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel--form,
.panel--sales {
  grid-column: span 6;
}

.panel--catalog,
.panel--history {
  grid-column: span 6;
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(22, 124, 120, 0.1);
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.85rem;
}

.pill--accent {
  background: rgba(255, 209, 102, 0.3);
  color: #8f5d12;
}

.stack {
  display: grid;
  gap: 16px;
}

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

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

.field-row,
.photo-actions,
.inline-field,
.checkout-actions,
.modal__actions {
  display: flex;
  gap: 12px;
}

.field-row .field,
.inline-field input {
  flex: 1;
}

input {
  width: 100%;
  border: 1px solid rgba(61, 44, 30, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  outline: none;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

input:focus {
  border-color: rgba(22, 124, 120, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(22, 124, 120, 0.08);
}

.button,
.link-button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 700;
}

.button:hover,
.link-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.link-button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

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

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

.button--secondary {
  background: var(--secondary);
  color: #fff;
}

.button--secondary:hover {
  background: var(--secondary-dark);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border: 1px solid rgba(61, 44, 30, 0.12);
}

.button--block {
  width: 100%;
}

.link-button {
  background: transparent;
  color: var(--secondary);
  font-weight: 700;
  padding: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(61, 44, 30, 0.08);
  color: var(--text);
}

.photo-preview {
  min-height: 160px;
  border-radius: 22px;
  border: 1px dashed rgba(61, 44, 30, 0.18);
  background: rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  color: var(--muted);
}

.photo-preview img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 18px;
  object-fit: cover;
}

.cart {
  margin-top: 16px;
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 239, 0.88));
  border: 1px solid rgba(116, 82, 43, 0.08);
}

.cart__header,
.cart__footer,
.product-card__footer,
.sale-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart__items,
.sales-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.cart-item,
.sale-card,
.product-card {
  border-radius: 20px;
  background: var(--surface-strong);
  border: 1px solid rgba(61, 44, 30, 0.08);
}

.cart-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.cart-item img,
.product-card img {
  width: 100%;
  height: 68px;
  object-fit: cover;
  border-radius: 16px;
  background: rgba(61, 44, 30, 0.06);
}

.cart-item__meta,
.product-card__meta {
  min-width: 0;
}

.cart-item__meta strong,
.product-card__meta strong {
  display: block;
  font-size: 1rem;
}

.cart-item__meta span,
.product-card__meta span,
.sale-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-item__actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.qty-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty-actions button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(22, 124, 120, 0.12);
  color: var(--secondary);
  font-weight: 700;
  cursor: pointer;
}

.danger {
  background: rgba(207, 75, 75, 0.12);
  color: var(--danger);
}

.product-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

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

.product-card__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.28);
  color: #8f5d12;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 10px;
}

.sale-card {
  padding: 14px 16px;
}

.sales-list:empty::before,
.product-grid:empty::before,
.cart__items:empty::before {
  content: "Nada por aqui ainda.";
  color: var(--muted);
  padding: 12px 2px;
}

.feedback {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(61, 44, 30, 0.9);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.feedback[data-tone="error"] {
  background: rgba(207, 75, 75, 0.96);
}

.feedback[data-tone="success"] {
  background: rgba(22, 124, 120, 0.96);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(44, 28, 17, 0.52);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal__dialog {
  width: min(520px, 100%);
  border-radius: 28px;
  padding: 20px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal video {
  width: 100%;
  min-height: 260px;
  border-radius: 22px;
  background: #000;
}

@media (max-width: 980px) {
  .hero,
  .panel--form,
  .panel--sales,
  .panel--catalog,
  .panel--history {
    grid-column: 1 / -1;
  }

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 20px;
  }

  .hero__content,
  .panel {
    padding: 20px;
  }

  .field-row,
  .photo-actions,
  .inline-field,
  .checkout-actions {
    flex-direction: column;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .cart-item img {
    width: 100%;
    height: 160px;
  }

  .cart-item__actions {
    justify-items: stretch;
  }
}
