:root {
  color-scheme: light;
  --bg: #fff7ec;
  --surface: #fffdf8;
  --panel: #ffffff;
  --panel-strong: #fff4dc;
  --ink: #0e1a2b;
  --muted: #665c50;
  --soft: #b8a996;
  --line: #e7d7bf;
  --brand: #ffb321;
  --brand-strong: #ff9f00;
  --brand-ink: #0e1a2b;
  --green: #43a047;
  --red: #e53935;
  --blue: #2458a6;
  --taupe: #b8a996;
  --cream: #fff7ec;
  --shadow: 0 16px 38px rgba(14, 26, 43, 0.1);
  --title-font: Poppins, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--body-font);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(184, 169, 150, 0.14) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, rgba(184, 169, 150, 0.1) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

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

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(20px, 5vw, 64px);
}

.auth-hero {
  display: grid;
  gap: 28px;
  max-width: 760px;
}

.auth-logo {
  display: block;
  width: min(340px, 100%);
  height: auto;
}

.auth-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

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

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-message {
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid rgba(67, 160, 71, 0.3);
  border-radius: 8px;
  background: rgba(67, 160, 71, 0.1);
  color: var(--green);
  font-weight: 800;
}

.form-error {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(229, 57, 53, 0.3);
  border-radius: 8px;
  background: rgba(229, 57, 53, 0.08);
  color: var(--red);
  font-weight: 800;
}

.auth-submit,
.auth-demo {
  width: 100%;
  min-height: 46px;
}

.auth-demo {
  background: transparent;
}

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

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: min(230px, 100%);
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

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

.nav-tabs,
.actions-row,
.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-tabs {
  justify-content: center;
}

.snack-topbar {
  background: rgba(14, 26, 43, 0.96);
  border-bottom-color: rgba(255, 179, 33, 0.3);
}

.snack-topbar .tab,
.snack-topbar .btn {
  background: rgba(255, 253, 248, 0.08);
  border-color: rgba(255, 253, 248, 0.2);
  color: #fff;
}

.snack-topbar .tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink);
}

.snack-topbar .brand-logo {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
}

.snack-topbar .brand {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface);
}

.tab,
.icon-btn,
.btn,
.chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.tab:hover,
.icon-btn:hover,
.btn:hover,
.chip:hover,
.product-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(14, 26, 43, 0.08);
}

.tab {
  padding: 0 14px;
  font-weight: 800;
}

.tab.active,
.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.icon-btn {
  display: grid;
  width: 44px;
  place-items: center;
  position: relative;
  font-size: 18px;
}

.badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-family: var(--title-font);
  font-size: 14px;
  font-weight: 800;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand-strong);
  color: var(--brand-ink);
}

.btn.dark {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn.danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.status-action {
  min-width: 92px;
}

.status-action.selected {
  opacity: 1;
  outline: 3px solid rgba(67, 160, 71, 0.22);
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px rgba(67, 160, 71, 0.18);
}

.status-action.loading {
  opacity: 1;
  position: relative;
  color: transparent;
}

.status-action.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(14, 26, 43, 0.2);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
}

.status-action.dark.loading::after {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.view {
  display: none;
  padding: 30px clamp(16px, 4vw, 44px) 46px;
}

.view.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 1px 0 rgba(14, 26, 43, 0.04);
}

.kicker {
  color: var(--brand-strong);
  font-family: var(--title-font);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  font-family: var(--title-font);
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 8px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.02;
}

h2 {
  margin-bottom: 12px;
}

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

.hero-note {
  width: min(290px, 100%);
  padding: 16px;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.hero-note strong,
.hero-note span {
  display: block;
}

.hero-note strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--title-font);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.catalog-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 12px;
  margin-bottom: 18px;
}

.catalog-tools > .input {
  flex: 1 1 280px;
  max-width: 360px;
}

.catalog-tools > .segmented {
  flex: 3 1 320px;
}

.input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 14px;
  color: var(--ink);
  outline: none;
}

.input:focus,
.option:focus-visible,
.tab:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
.icon-btn:focus-visible {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 3px rgba(255, 179, 33, 0.24);
}

.notify-btn {
  min-height: 42px;
  white-space: nowrap;
}

.chip {
  padding: 0 14px;
  min-height: 42px;
  font-family: var(--title-font);
  font-size: 14px;
  font-weight: 800;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.product-card,
.panel,
.order-card,
.metric,
.cart-item,
.slot-card,
.toast,
.payment-card,
.notification {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(14, 26, 43, 0.04);
}

.product-card {
  overflow: hidden;
}

.product-media {
  width: 100%;
  aspect-ratio: 1 / 0.78;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background:
    linear-gradient(135deg, rgba(255, 179, 33, 0.2), rgba(67, 160, 71, 0.12)),
    var(--cream);
  font-size: 62px;
}

.product-media:disabled {
  cursor: not-allowed;
}

.product-photo {
  display: block;
  width: min(72%, 180px);
  height: min(72%, 180px);
  margin: auto;
  object-fit: contain;
  object-position: center;
}

.product-body {
  padding: 14px;
}

.product-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-family: var(--title-font);
  font-weight: 800;
}

.product-title strong {
  color: var(--red);
  white-space: nowrap;
}

.stock-line {
  min-height: 22px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.stock-low {
  color: var(--brand-strong);
  font-weight: 900;
}

.stock-out {
  color: var(--red);
  font-weight: 900;
}

.panel {
  padding: 18px;
}

.demo-panel,
.settings-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.demo-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.cart-panel {
  position: sticky;
  top: 94px;
}

.cart-list,
.orders-list,
.notifications-list {
  display: grid;
  gap: 10px;
}

.cart-item,
.order-card,
.notification {
  padding: 12px;
}

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

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

.qty button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--title-font);
  font-size: 20px;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: end;
  justify-content: center;
  background: rgba(14, 26, 43, 0.4);
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(620px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.option-group {
  margin: 14px 0;
}

.option-label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

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

.option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  min-height: 38px;
  padding: 0 12px;
  font-weight: 800;
}

.option.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.option[disabled] {
  color: var(--soft);
  text-decoration: line-through;
}

.slots-grid,
.payment-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.slot-card,
.payment-card,
.metric {
  padding: 14px;
}

.slot-card.selected,
.payment-card.selected {
  outline: 3px solid rgba(255, 179, 33, 0.3);
  border-color: var(--brand-strong);
}

.slot-card.full {
  opacity: 0.45;
}

.progress {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.progress span.warn {
  background: var(--brand);
}

.progress span.danger {
  background: var(--red);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
}

.status.green {
  border-color: rgba(67, 160, 71, 0.35);
  background: rgba(67, 160, 71, 0.1);
  color: var(--green);
}

.status.red {
  border-color: rgba(229, 57, 53, 0.35);
  background: rgba(229, 57, 53, 0.08);
  color: var(--red);
}

.status.blue {
  border-color: rgba(36, 88, 166, 0.35);
  background: rgba(36, 88, 166, 0.08);
  color: var(--blue);
}

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

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav button {
  justify-content: flex-start;
}

.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

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

.metric-value {
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--title-font);
  font-size: 30px;
  font-weight: 900;
}

.toast-zone {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 14px;
  box-shadow: var(--shadow);
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

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

.field {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.field span,
.switch-line span {
  color: var(--muted);
  font-size: 13px;
}

.field-wide {
  grid-column: 1 / -1;
}

.textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

@media (max-width: 960px) {
  .auth-page {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .auth-card {
    max-width: 560px;
  }

  .topbar,
  .layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .brand-logo {
    width: min(220px, 100%);
    height: 52px;
  }

  .nav-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .hero-note {
    width: 100%;
  }

  .cart-panel {
    position: static;
  }

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

  .notify-btn {
    width: 100%;
  }

  .demo-panel {
    grid-template-columns: 1fr;
  }

  .topbar-switch {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .view {
    padding-inline: 12px;
  }

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

  .order-card {
    grid-template-columns: 1fr;
  }

  .order-actions {
    justify-content: start;
  }

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

  .cart-item .qty {
    grid-column: 2;
  }
}
