:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #eef4f1;
  --ink: #17201d;
  --muted: #62706b;
  --line: #d6dfda;
  --accent: #0f766e;
  --accent-dark: #0b675f;
  --accent-2: #c2410c;
  --good: #15803d;
  --bad: #9f1239;
  --warn: #b45309;
  --shadow: 0 16px 34px rgba(24, 38, 33, 0.11);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.7; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 245, 0.96);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.storefront-brand {
  color: var(--ink);
  text-decoration: none;
}

.storefront-brand-mark {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(15, 118, 110, 0.2));
}

.storefront-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.storefront-brand-name {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.storefront-brand-dot {
  color: #f59e0b;
}

.storefront-brand-pro {
  color: var(--accent);
}

.storefront-brand-tagline {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  font-size: 22px;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.04;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.top-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.top-meta span,
.top-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
}

.account-box { position: relative; }

.account-toggle {
  min-height: 34px;
  max-width: 210px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
  padding: 6px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: min(390px, calc(100vw - 24px));
  max-height: min(760px, calc(100vh - 92px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.account-panel[hidden] { display: none; }
.account-message {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.account-message.is-error { border-color: rgba(159, 18, 57, 0.25); color: var(--bad); background: #fff1f2; }
.account-message.is-success { border-color: rgba(21, 128, 61, 0.24); color: var(--good); background: #f0fdf4; }

.account-tab-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.account-tab-buttons button,
.profile-head button,
.history-head button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  padding: 0 10px;
}

.account-tab-buttons button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(22, 48, 42, 0.09);
}

.account-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.account-form button,
.profile-head button,
.history-head button {
  background: var(--accent);
  color: #fff;
}

.account-profile { display: grid; gap: 12px; }
.profile-head,
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.profile-head strong { display: block; font-size: 17px; }
.profile-head span { color: var(--muted); font-size: 13px; }
.profile-meta { display: grid; gap: 6px; }
.profile-meta span {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.order-history { display: grid; gap: 8px; }
.history-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}
.history-order {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.history-order summary {
  display: grid;
  grid-template-columns: minmax(78px, auto) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  cursor: pointer;
}
.history-order summary span { color: var(--muted); font-size: 12px; }
.history-order summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-order summary b { color: var(--accent); font-size: 13px; }
.history-lines { display: grid; gap: 6px; padding: 0 10px 10px; }
.history-lines div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-2);
}
.history-lines span,
.history-lines em { color: var(--muted); font-size: 12px; font-style: normal; }
.history-lines strong { font-size: 13px; line-height: 1.25; }

.layout {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 36px) 48px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(180px, 1fr) auto minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(28, 44, 38, 0.06);
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

input:focus, select:focus, button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.segment {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  padding: 0 12px;
}

.segment.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(22, 48, 42, 0.09);
}

.cart-toggle, .add-button, .cart-actions button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 0 14px;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.cart-toggle:hover, .add-button:hover, .cart-actions button:hover { background: var(--accent-dark); }
.cart-toggle.is-pulse { animation: cart-pulse 760ms ease; }
.cart-toggle span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 8px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.stats div {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stats span {
  display: block;
  font-size: 26px;
  line-height: 1;
  font-weight: 850;
}

.stats small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.product-card {
  cursor: pointer;
  display: grid;
  grid-template-rows: 260px minmax(278px, auto);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(27, 43, 38, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.product-card.in-cart {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 10px 26px rgba(15, 118, 110, 0.13);
}
.product-card.just-added { animation: product-added 760ms ease; }
.product-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16), 0 10px 26px rgba(15, 118, 110, 0.13);
  outline: none;
}

.product-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 260px;
  min-height: 260px;
  overflow: hidden;
  background: #edf2ef;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.product-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 12px;
}
.photo-fallback {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 8px;
  background: #17201d;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.product-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 18px 60px 34px minmax(34px, auto) minmax(74px, auto);
  gap: 8px;
  min-width: 0;
  min-height: 278px;
  padding: 13px;
  background: var(--surface);
}
.product-category {
  min-width: 0;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-card h2 {
  display: -webkit-box;
  height: 60px;
  margin: 0;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}
.product-codes {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}
.purchase-note {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 34px;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid rgba(21, 128, 61, 0.18);
  border-radius: 8px;
  background: #f0fdf4;
}
.purchase-note.is-empty { visibility: hidden; }
.purchase-note span,
.purchase-note strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.purchase-note span {
  color: var(--good);
  font-size: 12px;
  font-weight: 850;
}
.purchase-note strong {
  color: var(--warn);
  font-size: 11px;
  font-weight: 850;
}
.purchase-note strong.price-down { color: var(--good); }

.product-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  align-items: end;
  align-self: end;
  min-width: 0;
  padding-top: 8px;
}
.product-bottom > div { min-width: 0; }
.price {
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(20px, 2.1vw, 25px);
  line-height: 1.05;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.price.is-guest {
  overflow: visible;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: normal;
  text-overflow: clip;
  white-space: normal;
}
.stock {
  margin-top: 6px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock.ok { color: var(--good); }
.stock.empty { color: var(--bad); }
.add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 140px;
  min-width: 0;
  align-self: end;
  overflow: hidden;
  padding: 0 12px;
}
.add-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.add-button strong {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
}
.add-button.in-cart { justify-content: space-between; background: var(--accent-dark); }
.add-button:active { transform: translateY(1px); }
.add-button:disabled { background: #aeb9b4; }

.empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.cart-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  width: min(440px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cart-panel[hidden] { display: none; }
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.cart-head strong { display: block; font-size: 18px; }
.cart-head span { color: var(--muted); font-size: 13px; }
.cart-head button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}
.cart-items {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 12px;
}
.cart-items .empty { min-height: 180px; }
.cart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.cart-row.is-new { animation: cart-row-added 1050ms ease; }
.cart-row-main { min-width: 0; }
.cart-row strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
  line-height: 1.25;
}
.cart-row small { display: block; margin-top: 3px; color: var(--muted); }
.cart-row-price { display: block; margin-top: 5px; color: var(--accent); font-size: 12px; font-weight: 850; }
.qty-controls { display: grid; grid-template-columns: 30px 44px 30px; align-items: center; gap: 4px; }
.qty-controls button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 900;
}
.qty-controls input { height: 30px; padding: 0; text-align: center; }
.cart-notice {
  margin: 0 12px 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 800;
}
.cart-notice.is-error { border-color: rgba(159, 18, 57, 0.25); color: var(--bad); background: #fff1f2; }
.cart-notice.is-success { border-color: rgba(21, 128, 61, 0.24); color: var(--good); background: #f0fdf4; }
.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.cart-actions button:nth-child(2),
.cart-actions button:nth-child(3) {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

.add-toast {
  position: fixed;
  top: 88px;
  left: 50%;
  z-index: 90;
  display: grid;
  gap: 3px;
  width: min(430px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(15, 118, 110, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.add-toast[hidden] { display: none; }
.add-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.add-toast strong { color: var(--accent); font-size: 14px; }
.add-toast span { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.add-toast em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 800; }


.product-modal-open { overflow: hidden; }
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
}
.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 29, 0.48);
  backdrop-filter: blur(5px);
}
.product-modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.product-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(238, 244, 241, 0.95);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}
.product-modal-media {
  display: grid;
  min-height: 460px;
  overflow: hidden;
  place-items: center;
  border-right: 1px solid var(--line);
  background: #edf2ef;
}
.product-modal-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
  padding: 18px;
}
.product-modal-fallback {
  width: 120px;
  height: 120px;
  font-size: 40px;
}
.product-modal-content {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 26px;
  min-width: 0;
}
.product-modal-category {
  max-width: calc(100% - 52px);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}
.product-modal-content h2 {
  margin: 0;
  padding-right: 44px;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.12;
  letter-spacing: 0;
}
.product-modal-codes {
  color: var(--muted);
  font-weight: 750;
}
.product-modal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.product-modal-meta div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.product-modal-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.product-modal-meta strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-modal-purchase {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(21, 128, 61, 0.18);
  border-radius: 8px;
  background: #f0fdf4;
}
.product-modal-purchase strong,
.product-modal-purchase span,
.product-modal-purchase em {
  min-width: 0;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
}
.product-modal-purchase strong {
  color: var(--good);
  font-size: 14px;
  font-weight: 900;
}
.product-modal-purchase span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.product-modal-purchase em {
  color: var(--warn);
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}
.product-modal-purchase em.price-down { color: var(--good); }

.product-modal-description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.product-modal-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}
.product-modal-add {
  min-width: 180px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  padding: 0 18px;
}
.product-modal-add:hover { background: var(--accent-dark); }
.product-modal-add.in-cart { background: var(--accent-dark); }
.product-modal-add:disabled { background: #aeb9b4; }

.admin-body { background: #f5f6f4; }
.admin-layout {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 36px) 48px;
  display: grid;
  gap: 16px;
}
.admin-note,
.admin-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 800;
}
.admin-note { color: var(--good); background: #f0fdf4; border: 1px solid rgba(21, 128, 61, 0.22); }
.admin-error { color: var(--bad); background: #fff1f2; border: 1px solid rgba(159, 18, 57, 0.22); }
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(28, 44, 38, 0.06);
  overflow: hidden;
}
.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.admin-panel-head strong { font-size: 18px; }
.admin-panel-head span { color: var(--muted); font-weight: 800; }
.admin-client-list { display: grid; gap: 10px; padding: 12px; }
.admin-client-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 2fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.admin-client-card.is-pending { border-color: rgba(180, 83, 9, 0.38); background: #fffbeb; }
.admin-client-main { display: grid; align-content: start; gap: 5px; min-width: 0; }
.admin-client-main strong { font-size: 16px; }
.admin-client-main span,
.admin-client-main small { color: var(--muted); }
.admin-client-main .admin-device-state { color: var(--accent); font-weight: 800; }
.admin-client-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
}
.admin-client-stats { display: grid; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 800; }
.admin-client-stats strong { color: var(--accent); font-size: 15px; }
.admin-client-form button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  padding: 0 14px;
}
.admin-device-form { grid-column: 2; display: flex; align-items: end; justify-content: flex-end; }
.admin-device-form button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(159, 18, 57, .28);
  border-radius: 8px;
  color: var(--bad);
  background: #fff1f2;
  font-weight: 800;
}
.admin-device-form button:disabled { cursor: default; opacity: .45; }
.admin-order-table-wrap { overflow: auto; }
.admin-order-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.admin-order-table th,
.admin-order-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.admin-order-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.admin-order-table td small { display: block; margin-top: 3px; color: var(--muted); }
.empty-state { color: var(--muted); text-align: center; font-weight: 800; }

@keyframes product-added {
  0% { transform: translateY(0); }
  24% { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 18px 34px rgba(15, 118, 110, 0.2); }
  100% { transform: translateY(0); }
}
@keyframes cart-pulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.35); }
  70% { box-shadow: 0 0 0 10px rgba(15, 118, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}
@keyframes cart-row-added {
  0% { background: rgba(15, 118, 110, 0.12); border-color: var(--accent); box-shadow: 0 8px 20px rgba(15, 118, 110, 0.14); }
  100% { background: #fff; border-color: var(--line); box-shadow: none; }
}

@media (min-width: 1120px) {
  .cart-panel {
    top: 112px;
    right: 24px;
    bottom: 24px;
    width: 440px;
    max-height: none;
  }
}

@media (max-width: 1120px) {
  .admin-client-card { grid-template-columns: 1fr; }
  .admin-client-form { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .admin-device-form { grid-column: 1; justify-content: flex-start; }
}

@media (max-width: 940px) {
  .product-modal-card { grid-template-columns: 1fr; }
  .product-modal-media { min-height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: space-between; align-items: flex-start; }
  .top-meta { justify-content: flex-start; }
  .account-panel { right: auto; left: 0; }
  .controls { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .cart-toggle { width: 100%; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (max-width: 640px) {
  .storefront-brand-mark { width: 44px; height: 44px; }
  .storefront-brand-name { font-size: 25px; }
  .storefront-brand-tagline { font-size: 8px; letter-spacing: 0.18em; }
  .product-modal { padding: 10px; align-items: end; }
  .product-modal-card { width: 100%; max-height: calc(100vh - 20px); }
  .product-modal-media { height: 250px; min-height: 250px; }
  .product-modal-media img { max-height: 250px; }
  .product-modal-content { padding: 18px; gap: 11px; }
  .product-modal-content h2 { padding-right: 40px; font-size: 22px; }
  .product-modal-meta { grid-template-columns: 1fr; }
  .product-modal-add { width: 100%; }
  .topbar-actions { display: grid; width: 100%; gap: 8px; }
  .account-toggle { width: 100%; max-width: none; }
  .account-panel { position: fixed; top: 82px; left: 10px; right: 10px; width: auto; max-height: calc(100vh - 96px); }
  .controls { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-rows: 210px minmax(306px, auto); }
  .product-photo { height: 210px; min-height: 210px; }
  .product-body { min-height: 306px; grid-template-rows: 18px 60px 34px minmax(42px, auto) minmax(100px, auto); }
  .product-bottom { grid-template-columns: 1fr; align-items: stretch; }
  .add-button { width: 100%; }
  .add-toast { top: 10px; }
  .cart-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: min(72vh, 620px);
  }
  .cart-actions { grid-template-columns: 1fr; }
  .admin-client-form { grid-template-columns: 1fr; }
  .history-order summary { grid-template-columns: 1fr; }
}
