:root {
  color-scheme: light;
  --bg: #f7f4eb;
  --ink: #20382e;
  --muted: #52645b;
  --line: #deded0;
  --paper: #fffdf7;
  --yellow: #f9ca66;
  --green: #214a3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui,sans-serif;
}

header {
  border-bottom: 1px solid var(--line);
}

nav {
  max-width: 1100px;
  margin: auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

nav a {
  color: var(--green);
  text-decoration: none;
  font-weight: 650;
}

nav .brand {
  font-size: 19px;
}

.logo {
  display: inline-grid;
  place-items: center;
  background: var(--green);
  color: white;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  margin-right: 9px;
}

main {
  max-width: 1100px;
  margin: auto;
  padding: 38px 24px 64px;
}

.hero {
  background: var(--green);
  color: #fff9ea;
  padding: clamp(24px,5vw,54px);
  border-radius: 24px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.hero:after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border: 1px solid #ffffff30;
  border-radius: 50%;
  right: -60px;
  bottom: -160px;
  box-shadow: 0 0 0 28px #ffffff0d,0 0 0 56px #ffffff0d;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--yellow);
  font-weight: 750;
}

h1,h2 {
  font-family: Georgia,serif;
  line-height: 1.1;
  margin: 10px 0 14px;
}

h1 {
  font-size: clamp(38px,7vw,68px);
  letter-spacing: -.055em;
}

h2 {
  font-size: 29px;
  letter-spacing: -.03em;
}

p {
  margin: 0 0 14px;
}

.hero p:last-child {
  margin: 0;
  color: #e1eadf;
}

.layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 22px;
  align-items: start;
}

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

.muted {
  color: var(--muted);
  font-size: 14px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: 0;
}

.item {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 700;
}

.icon {
  background: #f4ecd8;
  border-radius: 12px;
  padding: 9px;
  font-size: 23px;
}

button,input,select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: white;
  font-weight: 700;
  padding: 11px 15px;
}

button:disabled {
  opacity: .48;
  cursor: default;
}

button.step {
  background: #edf0e7;
  color: var(--ink);
  min-width: 38px;
  padding: 7px;
}

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

.qty output {
  min-width: 20px;
  text-align: center;
}

label {
  display: block;
  font-weight: 650;
  margin: 12px 0 5px;
}

input,select {
  min-width: 0;
  width: 100%;
  background: white;
  border: 1px solid #b8c2b7;
  color: var(--ink);
  border-radius: 9px;
  padding: 10px;
}

.primary {
  width: 100%;
  margin-top: 16px;
  background: var(--yellow);
  color: var(--ink);
}

.error {
  color: #a22e25;
  margin-top: 10px;
}

.code {
  font-size: clamp(26px,6vw,45px);
  letter-spacing: .12em;
  font-weight: 800;
  background: #ebefe4;
  padding: 10px 15px;
  border-radius: 10px;
  overflow-wrap: anywhere;
  margin: 12px 0;
}

.toolbar {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 17px;
}

.toolbar>div {
  flex: 1;
  min-width: 160px;
}

.order {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions label {
  margin: 6px 0;
}

.actions select {
  display: block;
}

.pill {
  display: inline-block;
  border-radius: 99px;
  background: #e9eee4;
  padding: 4px 11px;
  margin: 0 6px 6px 0;
  font-weight: 650;
}

.note {
  margin-bottom: 18px;
}

.empty {
  padding: 16px 0;
  color: var(--muted);
}

[hidden] {
  display: none!important;
}

.overview {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(110px,1fr));
  gap: 8px;
  padding: 0;
  margin: 0 0 18px;
  list-style: none;
}

.overview li {
  background: #e9eee4;
  padding: 10px 12px;
  border-radius: 10px;
}

.overview strong {
  display: block;
  font-size: 22px;
}

#myOrders,#assortment {
  margin-top: 18px;
}

a {
  color: var(--green);
}

.check input {
  width: auto;
}

.actions input {
  width: 8rem;
  display: block;
}

.actions {
  align-items: center;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  max-width: calc(100% - 28px);
}

dialog::backdrop {
  background: #20382e88;
}

.bulk-order {
  margin-top: 14px;
}

.product-photo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
}

.photo-input {
  max-width: 16rem;
}

.photo-input input {
  width: 100%;
}

.bestseller-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 2px 2px 12px;
}

.bestseller-card {
  flex: 0 0 162px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: #f4ecd8;
  border-radius: 14px;
  padding: 12px;
}

.bestseller-card .item {
  display: block;
}

.bestseller-card .product-photo {
  display: block;
  width: 100%;
  height: 95px;
  margin-bottom: 8px;
}

.bestseller-card .qty {
  justify-content: space-between;
}

.category {
  border-top: 1px solid var(--line);
}

.category summary {
  cursor: pointer;
  padding: 13px 0;
  font-weight: 700;
}

.category .row {
  padding: 9px 0;
}

.category .row:last-child {
  margin-bottom: 9px;
}

#prepaid summary {
  cursor: pointer;
}

#prepaid summary + p {
  margin-top: 12px;
}

.prepaid-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.prepaid-fields > :not(button) {
  flex: 1;
  min-width: 125px;
}

.prepaid-credit-row {
  margin-bottom: 8px;
}

.prepaid-history {
  margin: 8px 0;
}

.prepaid-history ul {
  padding-left: 20px;
}

.prepaid-customer {
  border-top: 1px solid var(--line);
  margin-top: 12px;
}

.prepaid-customer > summary {
  padding: 12px 0;
}

.prepaid-summary {
  display: inline-flex;
  vertical-align: top;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 12px;
  max-width: calc(100% - 25px);
}

.prepaid-controls {
  margin: 10px 0;
}

#prepaidCreditForm {
  background: #f7f4eb;
  padding: 14px;
  border-radius: 12px;
  margin: 10px 0;
}


@media (max-width:700px) {
  nav {padding:12px 14px; gap:8px; flex-wrap:wrap}
  nav .brand {font-size:17px}
  main {padding:20px 12px 36px}
  .hero {padding:20px; margin-bottom:16px; border-radius:18px}
  h1 {font-size:clamp(30px, 8vw, 44px)}
  h2 {font-size:25px}
  .layout {grid-template-columns:minmax(0, 1fr); gap:14px}
  .panel {min-width:0; padding:14px; overflow-wrap:anywhere}
  .bestseller-cards {max-width:100%}
  .row, .item {gap:8px}
  .row > .item {min-width:0}
  .product-photo {width:48px; height:48px}
  .qty {flex:none; gap:4px}
  button.step {min-width:44px; min-height:44px}
  .toolbar > div {flex:1 1 145px; min-width:0}
  .actions > * {max-width:100%}
  #stockRows .row, .prepaid-customer .row {align-items:start; flex-direction:column}
}

.product-image {
  flex: none;
  margin: 0;
}

.product-image .product-photo {
  display: block;
  margin-bottom: 0;
}

.photo-caption {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 400;
  margin-top: 2px;
}

.sold-out {
  color: #a40e24;
  font-size: 1rem;
  font-weight: 700;
}

.bestseller-card .product-image {
  margin-bottom: 8px;
}

.actions .check input[type="checkbox"] {
  display: inline-block;
  width: auto;
}
