:root {
  --bg: #f7f7f4;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #6d6d66;
  --line: #ddddd5;
  --brand: #315f3b;
  --brand-2: #0b61c9;
  --danger: #c7272f;
  --warn: #c87519;
  --ok: #17834f;
  --shadow: 0 18px 46px rgba(17, 17, 17, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100%;
  letter-spacing: 0;
}

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

button,
a.button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 86px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.shell {
  min-height: 100vh;
  padding-bottom: 78px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(247, 247, 244, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(221, 221, 213, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  justify-content: flex-start;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.brand-copy {
  display: grid;
  min-width: 0;
}

.brand-copy strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: max-content;
}

.cart-pill {
  background: var(--brand);
  padding-inline: 12px;
}

.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

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

.success {
  background: var(--ok);
}

.blue {
  background: var(--brand-2);
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.page-head {
  display: grid;
  gap: 6px;
  margin: 8px 0 16px;
}

.page-head h1,
.page-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.08;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
}

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.hero-action {
  min-height: 118px;
  border-radius: var(--radius);
  padding: 18px;
  justify-content: flex-start;
  align-items: flex-end;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.hero-action strong {
  font-size: 24px;
  line-height: 1;
  white-space: normal;
}

.hero-action span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
}

.quick-card {
  min-height: 82px;
  padding: 14px;
  justify-content: flex-start;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.quick-card strong {
  white-space: normal;
  text-align: left;
}

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

.stat {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-button {
  min-height: 74px;
  display: grid;
  justify-content: start;
  align-content: center;
  text-align: left;
  color: var(--ink);
}

.stat-button.active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.stat strong {
  display: block;
  font-size: 20px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  position: sticky;
  top: 63px;
  z-index: 30;
  background: rgba(247, 247, 244, 0.95);
  padding: 8px 0 10px;
  backdrop-filter: blur(12px);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

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

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.product {
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 150px;
  overflow: hidden;
}

.product-media {
  background: #f1f1ed;
  min-height: 150px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
}

.product-media img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  padding: 8px;
}

.product-body {
  padding: 12px;
  display: grid;
  gap: 9px;
  align-content: space-between;
}

.product-title {
  display: grid;
  gap: 4px;
}

.product-title strong {
  line-height: 1.12;
}

.product-title span,
.meta {
  color: var(--muted);
  font-size: 12px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.product-foot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.price {
  font-size: 18px;
  font-weight: 900;
}

.stepper {
  justify-self: end;
  display: grid;
  grid-template-columns: 40px minmax(36px, auto) 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.stepper button {
  min-height: 38px;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 0;
}

.stepper span {
  min-width: 36px;
  text-align: center;
  font-weight: 900;
}

.upsell {
  margin-top: 16px;
}

.upsell-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mini-product {
  flex: 0 0 210px;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  padding: 8px;
  align-items: center;
}

.mini-product img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #f2f2ee;
  border-radius: 6px;
}

.mini-product strong {
  line-height: 1.1;
}

.mini-product button {
  min-height: 34px;
  padding: 6px 10px;
  margin-top: 6px;
}

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

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

.cart-item img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #f2f2ee;
  border-radius: 6px;
}

.cart-item-main {
  display: grid;
  gap: 8px;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.cart-total {
  position: sticky;
  bottom: 72px;
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-top: 14px;
}

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

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

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

.checkline {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  text-transform: none;
  font-size: 14px;
}

.checkline input {
  width: auto;
}

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

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

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef7f1;
  color: var(--ok);
  font-weight: 900;
  font-size: 12px;
}

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

.timeline-step {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  color: var(--muted);
  align-items: center;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line);
  justify-self: center;
}

.timeline-step.done {
  color: var(--ink);
  font-weight: 800;
}

.timeline-step.done .dot {
  background: var(--ok);
  border-color: var(--ok);
}

.admin-layout {
  display: grid;
  gap: 14px;
}

.admin-table {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #f2f2ee;
  border-radius: 6px;
}

.admin-form {
  padding: 14px;
}

.link-button {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  text-decoration: underline;
  white-space: normal;
  justify-content: flex-start;
}

.image-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.image-option {
  border: 2px solid transparent;
  background: #f2f2ee;
  border-radius: 6px;
  min-height: 76px;
  padding: 4px;
}

.image-option.active {
  border-color: var(--brand);
}

.image-option img {
  width: 100%;
  height: 68px;
  object-fit: contain;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  color: var(--muted);
}

.bottom-nav {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-item {
  min-height: 64px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  gap: 2px;
  padding: 8px 2px;
  font-size: 11px;
}

.nav-item strong {
  font-size: 20px;
  line-height: 1;
}

.nav-item.active {
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 86px;
  z-index: 80;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.hidden {
  display: none !important;
}

@media (min-width: 680px) {
  .main {
    padding: 22px;
  }

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

  .hero-action {
    grid-row: span 2;
    min-height: 176px;
  }

  .toolbar {
    grid-template-columns: minmax(280px, 1fr) auto;
    align-items: center;
  }

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

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

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

  .admin-layout {
    grid-template-columns: 380px 1fr;
    align-items: start;
  }
}

@media (max-width: 480px) {
  button,
  a.button {
    padding-inline: 10px;
  }

  .topbar {
    gap: 6px;
    padding: 8px 10px;
  }

  .brand {
    padding: 6px 8px;
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-copy strong {
    font-size: 13px;
  }

  .brand-copy span {
    font-size: 11px;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions button {
    min-height: 40px;
    font-size: 13px;
  }
}

@media (min-width: 1040px) {
  .shell {
    padding-bottom: 0;
    display: grid;
    grid-template-columns: 240px 1fr;
  }

  .topbar {
    grid-column: 1 / -1;
  }

  .bottom-nav {
    position: sticky;
    top: 64px;
    align-self: start;
    height: calc(100vh - 64px);
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, 64px);
    border-top: 0;
    border-right: 1px solid var(--line);
    background: #fff;
  }

  .nav-item {
    grid-template-columns: 34px 1fr;
    justify-content: start;
    text-align: left;
    padding-inline: 18px;
  }

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

  .cart-total {
    bottom: 18px;
  }
}
