:root {
  color-scheme: light;
  --ink: #142018;
  --muted: #657166;
  --line: #dfe9df;
  --paper: #f6faf3;
  --panel: #ffffff;
  --green: #058348;
  --green-dark: #06472b;
  --mint: #e4f5e7;
  --orange: #ec7d21;
  --gold: #f6c45f;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(28, 72, 42, .12);
  --soft-shadow: 0 10px 24px rgba(34, 79, 45, .08);
  font-family: "Aptos", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(246, 196, 95, .24), transparent 24rem),
    linear-gradient(180deg, #fffaf0 0%, var(--paper) 44%, #fbfcf8 100%);
}

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

button,
a.soft-button,
.ghost-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

button:hover,
a.soft-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

.primary-button {
  border-color: var(--green);
  color: #fff;
  background: linear-gradient(135deg, #059452, #047744);
  font-weight: 650;
}

.danger-button {
  color: var(--danger);
  border-color: rgba(180, 35, 24, .22);
  background: #fff8f7;
}

.ghost-button,
a.soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
}

.hidden {
  display: none !important;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--orange);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fcfdf9;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(5, 131, 72, .48);
  box-shadow: 0 0 0 3px rgba(5, 131, 72, .12);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: contain;
  padding: 4px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}

.brand-mark strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 600;
}

.brand-mark small {
  display: block;
  color: currentColor;
  opacity: .68;
  font-weight: 650;
}

.store-hero {
  padding: 18px clamp(16px, 4vw, 44px) 30px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(5, 58, 37, .98), rgba(5, 137, 76, .92)),
    url("assets/logo.png") right -42px center / 280px auto no-repeat;
  border-bottom: 5px solid var(--gold);
}

.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.store-hero .soft-button {
  color: #fff;
  border-color: rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .12);
}

.hero-copy {
  max-width: 780px;
  margin: 46px auto 0;
  text-align: center;
}

.hero-copy p {
  margin-bottom: 12px;
  color: #ffe8ad;
  font-size: clamp(.9rem, 1.8vw, 1rem);
  font-weight: 650;
  line-height: 1.45;
}

.hero-copy h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 6vw, 5rem);
  line-height: .98;
  font-weight: 500;
}

.store-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px clamp(14px, 4vw, 36px) 96px;
}

.catalog-head,
.featured-bar,
.security-note,
.checkout,
.table-panel,
.editor-panel,
.metrics-row article,
.order-card {
  border: 1px solid rgba(6, 71, 43, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--soft-shadow);
}

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.catalog-head h2,
.checkout h2,
.table-panel h2,
.editor-panel h2 {
  font-size: 1.45rem;
  font-weight: 600;
}

.featured-bar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 15px 16px;
  background: linear-gradient(135deg, #fff8df, #eefbe8);
}

.featured-bar div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.featured-bar strong,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--green-dark);
  background: #fff;
  font-size: .86rem;
  font-weight: 650;
}

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

.security-note {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 16px 18px;
  color: var(--green-dark);
  background: linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(231, 247, 232, .92));
}

.security-note strong {
  font-weight: 700;
}

.security-note p {
  max-width: 760px;
  font-size: .92rem;
  line-height: 1.45;
}

.store-product {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 128px;
  align-items: center;
  gap: 16px;
  min-height: 128px;
  padding: 12px;
  border: 1px solid rgba(6, 71, 43, .11);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.store-product.featured {
  border-color: rgba(236, 125, 33, .28);
  background: linear-gradient(135deg, #fffefa, #f4fff0);
}

.product-photo {
  display: grid;
  place-items: center;
  width: 116px;
  height: 104px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, #e8f8df, #fff3d8);
}

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

.product-photo.has-photo img {
  object-fit: cover;
  padding: 0;
}

.product-copy {
  min-width: 0;
}

.product-copy h3 {
  margin-top: 5px;
  font-size: 1.12rem;
  font-weight: 650;
}

.product-copy p {
  margin-top: 5px;
  line-height: 1.4;
}

.product-buy {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.product-buy strong {
  color: var(--green-dark);
  font-size: 1.15rem;
  font-weight: 750;
}

.floating-cart {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  width: min(94vw, 620px);
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #047f45, #079957);
  box-shadow: 0 18px 38px rgba(6, 71, 43, .28);
  transform: translateX(-50%);
}

.floating-cart:hover {
  transform: translateX(-50%) translateY(-1px);
}

.checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 26, 19, .54);
  backdrop-filter: blur(6px);
}

.checkout {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(94vw, 460px);
  max-height: 92vh;
  overflow: auto;
  padding: 20px;
}

.icon-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
}

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

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

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
}

.total {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  font-weight: 750;
}

.cart-empty,
.message,
.empty-state {
  color: var(--muted);
}

.checkout-security {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid rgba(5, 131, 72, .14);
  border-radius: 12px;
  color: var(--green-dark);
  background: #f0f8ef;
}

.checkout-security strong {
  font-size: .92rem;
  font-weight: 700;
}

.checkout-security span {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.35;
}

.admin-body {
  min-height: 100vh;
  background: #eef6ed;
}

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

.login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(94vw, 420px);
  padding: 28px;
  border: 1px solid rgba(6, 71, 43, .12);
  border-radius: 22px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.login-card img {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}

.login-card h1 {
  font-size: 2rem;
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  display: grid;
  align-content: start;
  gap: 22px;
  height: 100vh;
  padding: 22px;
  color: #fff;
  background: linear-gradient(180deg, #053a25, #065936);
}

.admin-tabs {
  display: grid;
  gap: 8px;
}

.tab-button {
  justify-content: flex-start;
  width: 100%;
  color: rgba(255, 255, 255, .78);
  border-color: rgba(255, 255, 255, .12);
  background: transparent;
  text-align: left;
}

.tab-button.active {
  color: #06351f;
  background: #fff;
}

.rail-link {
  margin-top: 8px;
  color: #fff;
  border-color: rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .12);
}

.work-area {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 22px clamp(18px, 3vw, 34px) 34px;
}

.work-header,
.panel-title-row,
.metrics-row,
.product-table-head,
.product-row,
.order-card-top,
.customer-row,
.pill-row,
.order-items,
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.work-header,
.panel-title-row {
  justify-content: space-between;
}

.work-header h1 {
  font-size: 2.2rem;
  font-weight: 600;
}

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

.metrics-row article {
  padding: 15px;
}

.metrics-row small {
  color: var(--muted);
  font-weight: 650;
}

.metrics-row strong {
  display: block;
  margin-top: 5px;
  color: var(--green-dark);
  font-size: 2rem;
  font-weight: 500;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 16px;
}

.product-workbench {
  grid-template-columns: minmax(0, .96fr) minmax(340px, .72fr);
  align-items: start;
}

.settings-workbench {
  max-width: 980px;
}

.table-panel,
.editor-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, .92);
}

.editor-panel {
  position: sticky;
  top: 22px;
}

.editor-panel.wide {
  position: static;
}

.search-input {
  min-height: 42px;
}

.product-table-head,
.product-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 150px;
  align-items: center;
}

.product-table-head {
  padding: 0 12px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.product-table {
  display: grid;
  gap: 8px;
}

.product-row {
  min-height: 62px;
  text-align: left;
  border-color: rgba(6, 71, 43, .10);
}

.product-row.active {
  border-color: rgba(5, 131, 72, .34);
  background: var(--mint);
}

.product-row span,
.product-row strong,
.product-row small {
  min-width: 0;
}

.product-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.product-row small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-row b,
.product-row em {
  color: var(--green-dark);
  font-style: normal;
  font-weight: 650;
  text-align: right;
}

.product-row em {
  color: var(--muted);
  font-size: .86rem;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
}

.switch-row {
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 14px;
  background: var(--mint);
}

.switch-row.calm {
  background: #f0f7ee;
}

.switch-row label {
  display: inline-flex;
  align-items: center;
  color: var(--green-dark);
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

input[type="file"] {
  min-width: 0;
  overflow: hidden;
  font-size: .86rem;
}

.slot-grid {
  display: grid;
  gap: 10px;
}

.slot-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 120px auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(6, 71, 43, .10);
  border-radius: 14px;
  background: #fbfdf7;
}

.slot-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--green-dark);
  font-weight: 650;
}

.slot-check {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--green-dark);
}

.orders-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}

.order-card {
  display: grid;
  gap: 12px;
  padding: 15px;
}

.order-card-top {
  justify-content: space-between;
  align-items: flex-start;
}

.order-card-top strong,
.order-card-top b {
  color: var(--green-dark);
  font-weight: 700;
}

.order-card-top small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.customer-row {
  flex-wrap: wrap;
}

.customer-row span {
  color: var(--muted);
}

.customer-row span::before {
  content: "- ";
}

.pill-row,
.order-items {
  flex-wrap: wrap;
}

.pill-row span,
.order-items span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--green-dark);
  background: var(--mint);
  font-size: .84rem;
  font-weight: 650;
}

.panel-title-row.compact {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.panel-title-row.compact h3 {
  font-size: 1rem;
  font-weight: 650;
}

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

  .side-rail {
    position: static;
    height: auto;
  }

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

  .product-workbench {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .store-hero {
    padding: 14px 14px 24px;
  }

  .top-nav {
    align-items: flex-start;
  }

  .brand-mark img {
    width: 52px;
    height: 52px;
  }

  .hero-copy {
    margin-top: 34px;
    text-align: left;
  }

  .catalog-head,
  .work-header,
  .panel-title-row {
    display: grid;
    justify-content: stretch;
  }

  .store-product {
    grid-template-columns: 94px minmax(0, 1fr);
  }

  .product-photo {
    width: 94px;
    height: 94px;
  }

  .product-buy {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: stretch;
  }

  .floating-cart {
    bottom: 10px;
    grid-template-columns: 1fr auto;
    border-radius: 18px;
  }

  .floating-cart span:last-child {
    grid-column: 1 / -1;
    text-align: center;
  }

  .work-area {
    padding: 16px 12px 28px;
  }

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

  .admin-tabs {
    grid-template-columns: 1fr;
  }

  .product-table-head {
    display: none;
  }

  .product-row {
    grid-template-columns: 1fr;
  }

  .product-row b,
  .product-row em {
    text-align: left;
  }

  .slot-card {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
  }

  .slot-card .danger-button,
  .slot-check {
    grid-column: 2;
  }
}
