:root {
  --ink: #172026;
  --muted: #66717a;
  --line: #dce3df;
  --panel: #ffffff;
  --soft: #f5f7f2;
  --green: #0d6b45;
  --green-dark: #08442e;
  --yellow: #ffd231;
  --red: #cf2434;
  --blue: #245a93;
  --orange: #c46518;
  --shadow: 0 16px 38px rgba(23, 32, 38, 0.1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f2f5f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
select,
label.file-button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

h1 {
  max-width: 820px;
  font-size: 36px;
  line-height: 1.05;
}

h2 {
  font-size: 22px;
  line-height: 1.15;
}

h3 {
  font-size: 16px;
  line-height: 1.2;
}

a {
  color: inherit;
}

.icon-sprite {
  display: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(8, 68, 46, 0.14);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--green-dark);
  text-decoration: none;
}

.brand-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}

.brand-logo rect {
  fill: var(--green);
  stroke: var(--green-dark);
}

.brand-logo path {
  stroke: var(--yellow);
  stroke-width: 5;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 24px;
  font-weight: 950;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.header-search,
.table-search {
  position: relative;
}

.header-search svg,
.table-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.header-search input,
.table-search input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  outline: none;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(13, 107, 69, 0.12);
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mode-button,
.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.quantity-button,
.load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  border: 0;
  font-weight: 900;
}

.mode-button {
  min-width: 94px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
}

.mode-button.active {
  color: var(--green-dark);
  background: var(--yellow);
}

.account-strip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 42px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.header-action-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 950;
}

.header-action-button:hover,
.header-action-button:focus-visible,
.header-action-button.active {
  border-color: var(--green);
  color: var(--green-dark);
  background: #edf7ef;
}

.cart-header-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  color: #1e1b04;
  background: var(--yellow);
  font-size: 12px;
}

.text-button {
  min-height: 30px;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-weight: 950;
}

.primary-button {
  width: 100%;
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(13, 107, 69, 0.2);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--green-dark);
}

.secondary-button {
  min-width: 104px;
  padding: 0 13px;
  color: var(--green-dark);
  border: 1px solid rgba(13, 107, 69, 0.26);
  background: #edf7ef;
  text-decoration: none;
}

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

.icon-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.store-band,
.admin-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  background: var(--green-dark);
  color: #fff;
}

.store-band {
  border-bottom: 8px solid var(--yellow);
}

.admin-band {
  background: #1c2f3d;
  border-bottom: 8px solid #9bd0f5;
}

.eyebrow {
  margin-bottom: 6px;
  color: currentColor;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.78;
}

.store-band-metrics,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.store-band-metrics span {
  display: grid;
  min-width: 118px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #e9f7ee;
  font-size: 12px;
  font-weight: 800;
}

.store-band-metrics strong {
  color: var(--yellow);
  font-size: 24px;
}

.auth-panel,
.account-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 22px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.register-form {
  display: grid;
  gap: 12px;
  width: 100%;
}

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-actions-row .primary-button,
.form-actions-row .ghost-button {
  width: auto;
  flex: 1 1 190px;
}

.auth-form .primary-button,
.auth-form .secondary-button {
  width: auto;
  min-width: 130px;
}

.admin-auth-panel {
  margin: 22px;
}

.cart-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--green-dark);
  background: #edf7ef;
  font-size: 13px;
  font-weight: 950;
}

.customer-tabs,
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 22px 0;
}

.customer-tab,
.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 950;
}

.customer-tab.active,
.admin-tab.active {
  color: var(--green-dark);
  border-color: rgba(13, 107, 69, 0.35);
  background: var(--yellow);
}

.store-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 22px;
}

.filters-panel,
.selected-panel,
.cart-panel,
.account-page,
.category-page,
.receipt-panel,
.product-form,
.inventory-panel,
.coupon-panel,
.delivery-panel,
.admin-page-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.filters-panel {
  padding: 18px;
}

.category-page,
.account-page,
.receipt-panel,
.admin-page-panel {
  padding: 18px;
}

.account-page {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
}

.account-page .auth-panel,
.account-page .account-panel,
.account-page .receipt-panel {
  margin: 0;
  box-shadow: none;
}

.account-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.category-page {
  position: sticky;
  top: 94px;
  grid-column: 1;
  align-self: start;
}

.products-area {
  grid-column: 2;
}

.cart-panel,
.receipt-panel {
  grid-column: 1 / -1;
}

.store-layout[data-customer-page="categories"] {
  grid-template-columns: 1fr;
}

.store-layout[data-customer-page="account"],
.store-layout[data-customer-page="cart"] {
  grid-template-columns: 1fr;
}

.store-layout[data-customer-page="categories"] .category-page {
  position: static;
  grid-column: 1 / -1;
}

.store-layout[data-customer-page="categories"] .category-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.filter-block + .filter-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.category-rail {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 250px);
  overflow: auto;
  padding-right: 4px;
}

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

.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
  text-align: left;
}

.category-button.active {
  border-color: var(--green);
  color: var(--green-dark);
  background: #edf7ef;
}

.category-button small {
  color: var(--muted);
  font-size: 12px;
}

.products-area {
  min-width: 0;
}

.store-tools {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(140px, 220px) auto;
  gap: 10px;
  align-items: end;
}

.section-toolbar,
.selected-header,
.cart-header,
.form-title,
.admin-row-main,
.admin-row-actions,
.selected-item,
.cart-item,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-toolbar {
  margin-bottom: 16px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.product-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
}

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

.product-badge,
.stock-badge,
.featured-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

.product-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  color: #1e1b04;
  background: var(--yellow);
}

.sale-badge {
  top: 40px;
  color: #fff;
  background: var(--red);
}

.product-body {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 10px;
  min-width: 0;
  padding: 14px;
}

.product-kicker {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.product-kicker span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.product-title {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 17px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pack-size {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.price {
  color: var(--green-dark);
  font-size: 24px;
  font-weight: 950;
}

.was-price {
  display: inline-block;
  margin-left: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-decoration: line-through;
}

.stock-note {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.quantity-control {
  display: grid;
  grid-template-columns: 36px minmax(38px, 1fr) 36px;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.quantity-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  color: var(--green-dark);
  border: 1px solid rgba(13, 107, 69, 0.24);
  background: #edf7ef;
}

.quantity-input {
  height: 36px;
  min-width: 0;
  padding: 0 6px;
  text-align: center;
  font-weight: 950;
}

.details-button {
  min-height: 36px;
  padding: 0 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
  overflow-wrap: anywhere;
}

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

.load-more {
  width: 100%;
  margin-top: 18px;
  color: var(--green-dark);
  border: 1px solid rgba(13, 107, 69, 0.28);
  background: #fff;
}

.load-more[hidden] {
  display: none;
}

.selected-panel,
.cart-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.cart-panel {
  width: min(780px, 100%);
  margin: 0 auto;
}

.selected-items,
.cart-items {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 310px);
  overflow: auto;
  padding-right: 4px;
}

.selected-item,
.cart-item {
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.selected-item strong,
.selected-item span,
.cart-item strong,
.cart-item span {
  display: block;
}

.selected-item span,
.cart-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cart-totals {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cart-totals div,
.selected-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 950;
}

.cart-grand-total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.selected-total strong,
.cart-totals strong {
  color: var(--green-dark);
  font-size: 24px;
}

.checkout-form,
.card-fields {
  display: grid;
  gap: 12px;
}

.checkout-form {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  text-align: center;
  font-weight: 800;
}

.admin-actions .ghost-button,
.admin-actions .secondary-button {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.admin-actions .secondary-button:hover,
.admin-actions .ghost-button:hover {
  border-color: #fff;
  color: #fff;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px 0;
}

.admin-stats article {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  color: var(--ink);
}

.admin-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 22px;
}

.admin-layout.single-panel {
  grid-template-columns: 1fr;
}

.product-form {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.photo-field {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
}

.photo-field img {
  width: 120px;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

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

.check-label {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.status-line {
  min-height: 20px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 850;
}

.inventory-panel,
.coupon-panel,
.delivery-panel,
.admin-page-panel {
  padding: 18px;
}

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

.coupon-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.delivery-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.delivery-area-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.area-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.area-check {
  min-width: 0;
  min-height: 38px;
  padding: 8px;
}

.area-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.delivery-day-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.delivery-day-card legend {
  padding: 0 4px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 950;
}

.coupon-row,
.coupon-row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.coupon-row-card {
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.coupon-row-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.receipt-list,
.report-list {
  display: grid;
  gap: 12px;
}

.receipt-card,
.report-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.receipt-head,
.report-row,
.report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.receipt-head span,
.report-row span,
.report-meta,
.receipt-totals {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.receipt-items {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.receipt-items li,
.receipt-totals,
.report-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.report-meta .secondary-button {
  width: auto;
  min-height: 34px;
}

.report-actions {
  flex-wrap: wrap;
}

.metric-card strong {
  color: var(--green-dark);
  font-size: 24px;
}

.metric-card small {
  color: var(--muted);
  font-weight: 800;
}

.vat-rates-form {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.report-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

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

.report-table th {
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.report-table td strong,
.report-table td span {
  display: block;
}

.report-table td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-card {
  overflow: hidden;
}

.customer-order-list {
  display: grid;
  gap: 8px;
}

.customer-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.customer-order-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-order-row .secondary-button {
  width: auto;
  min-height: 34px;
}

.route-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.inventory-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px;
  gap: 10px;
  align-items: center;
}

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

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 470px;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-row-main {
  justify-content: flex-start;
  min-width: 0;
}

.admin-row-main img {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  object-fit: contain;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.admin-row-main h3 {
  overflow-wrap: anywhere;
}

.admin-row-main p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-row-actions {
  justify-content: flex-end;
}

.mini-field {
  display: grid;
  gap: 4px;
  width: 88px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 900;
}

.mini-field input {
  height: 38px;
  padding: 0 8px;
}

.stock-badge {
  color: #0f5132;
  background: #dcfce7;
}

.stock-badge.low {
  color: #854d0e;
  background: #fef3c7;
}

.stock-badge.out,
.stock-badge.hidden {
  color: #991b1b;
  background: #fee2e2;
}

.featured-badge {
  color: #2b2200;
  background: var(--yellow);
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 74px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.switch-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

dialog {
  width: min(760px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

dialog::backdrop {
  background: rgba(23, 32, 38, 0.58);
}

.dialog-card {
  position: relative;
  padding: 22px;
  background: #fff;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.dialog-product {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-right: 34px;
}

.dialog-product img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.dialog-product h2 {
  margin-bottom: 8px;
  font-size: 26px;
}

.dialog-product p {
  color: var(--muted);
  line-height: 1.5;
}

.dialog-product dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 18px 0 0;
}

.dialog-product dt {
  color: var(--muted);
  font-weight: 950;
}

.dialog-product dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .store-layout {
    grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  }

  .selected-panel,
  .cart-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .selected-items,
  .cart-items {
    max-height: 260px;
  }

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

  .product-form {
    position: static;
  }

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

  .admin-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .brand {
    justify-content: center;
  }

  .store-band,
  .admin-band,
  .section-toolbar,
  .selected-header,
  .cart-header,
  .form-title {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 30px;
  }

  .store-layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .category-page,
  .products-area {
    grid-column: 1 / -1;
  }

  .category-page {
    position: static;
  }

  .filters-panel {
    position: static;
  }

  .category-grid {
    display: flex;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .category-button {
    min-width: 160px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px 16px 0;
  }

  .admin-layout {
    padding: 16px;
  }

  .inventory-tools,
  .form-grid,
  .check-row,
  .photo-field,
  .dialog-product,
  .auth-form,
  .store-tools,
  .coupon-row,
  .coupon-row-card,
  .customer-order-row {
    grid-template-columns: 1fr;
  }

  .receipt-head,
  .report-row,
  .report-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .dialog-product {
    padding-right: 0;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 12px;
  }

  .store-band,
  .admin-band {
    padding: 20px 16px;
  }

  h1 {
    font-size: 26px;
  }

  .store-band-metrics,
  .admin-actions {
    justify-content: stretch;
  }

  .store-band-metrics span,
  .admin-actions > * {
    flex: 1 1 100%;
  }

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

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

  .mode-button {
    min-width: 0;
  }
}

@media print {
  body {
    background: #fff;
  }

  .no-print,
  .site-header,
  .admin-band,
  .admin-stats,
  .admin-layout,
  dialog {
    display: none !important;
  }

  .store-band {
    color: #111;
    background: #fff;
    border: 0;
    padding: 0 0 16px;
  }

  .store-layout {
    display: block;
    padding: 0;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .product-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .quantity-control,
  .details-button {
    display: none;
  }
}
