:root {
  --bg-primary: #0a0b0f;
  --bg-secondary: #0f1117;
  --bg-card: #121418;
  --bg-card-hover: #161920;
  --bg-input: #1a1d24;
  --bg-modal: #13161c;
  --text-primary: #e1e1e6;
  --text-secondary: #c7c7d1;
  --text-muted: #9399a8;
  --accent: #e85d3a;
  --accent-hover: #ff6b4a;
  --accent-gradient: linear-gradient(135deg, #e85d3a, #ff7b5a);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --border: #1e2130;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-md: 0 4px 6px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.5);
  --shadow-glow: 0 0 20px rgba(232,93,58,.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent), transparent 25%) rgba(255,255,255,.05);
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track {
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.05);
}
*::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg-primary);
  border-radius: var(--radius-full);
  background: var(--accent);
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  background: radial-gradient(circle at top left, rgba(232,93,58,.12), transparent 38%), var(--bg-primary);
  font-family: Inter, Segoe UI, system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { transition: .15s ease; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.promo-banner {
  position: relative;
  overflow: hidden;
  width: min(1240px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 14px 48px;
  text-align: center;
  font-weight: 700;
  background: linear-gradient(100deg, var(--promo-a, #e85d3a), var(--promo-b, #22c55e));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.promo-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.24), transparent);
  transform: translateX(-100%);
  animation: shimmer 3s infinite;
}
.promo-banner code {
  position: relative;
  z-index: 1;
  margin-left: 12px;
  padding: 4px 9px;
  border: 1px dashed rgba(255,255,255,.75);
  border-radius: var(--radius-sm);
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
}
.promo-banner button {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 7px;
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 64px;
  padding: 0 28px;
  background: rgba(15,17,23,.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
}
.brand-mark, .login-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--accent-gradient);
  border-radius: 12px;
  box-shadow: var(--shadow-glow);
}
.brand strong { display: block; font-size: 18px; }
.brand small { display: block; color: var(--text-muted); font-size: 12px; }
.server-tabs button, .filter-trigger, .ghost-btn, .icon-btn, .select-control {
  border: 1px solid var(--border);
  color: var(--text-primary);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.server-tabs button.active, .filter-menu button.active {
  border-color: color-mix(in srgb, var(--accent), white 12%);
  color: white;
  background: color-mix(in srgb, var(--accent), transparent 84%);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.ghost-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; }
.ghost-btn:hover, .icon-btn:hover, .filter-trigger:hover { border-color: var(--accent); }
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
}
.badge {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 19px;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  color: white;
  background: var(--danger);
  font-size: 11px;
}

.shop-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto 54px;
}
.shop-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: clamp(26px, 5vw, 52px);
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, rgba(232,93,58,.22), rgba(34,197,94,.10)),
    radial-gradient(circle at 80% 20%, rgba(59,130,246,.16), transparent 35%),
    var(--bg-card);
  box-shadow: var(--shadow-lg);
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-hover);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
}
.shop-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 6vw, 70px);
  line-height: .98;
  letter-spacing: 0;
}
.shop-hero p:not(.eyebrow) {
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.6;
}
.hero-status {
  display: grid;
  gap: 8px;
  justify-items: end;
  color: var(--text-secondary);
}
.hero-status strong {
  color: var(--text-primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
}

.catalog-head {
  position: sticky;
  top: 64px;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 18px 0;
  background: linear-gradient(180deg, var(--bg-primary) 75%, transparent);
}
.catalog-head h2 { margin: 0; font-size: 26px; }
.catalog-head p { margin: 4px 0 0; color: var(--text-muted); }
.catalog-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.dropdown-filter { position: relative; }
.filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 13px;
}
.filter-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 300;
  display: grid;
  gap: 6px;
  width: 250px;
  max-height: 320px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-modal);
  box-shadow: var(--shadow-lg);
}
.filter-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.search-box {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  min-width: 220px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--bg-input);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text-primary);
  background: transparent;
}
.search-box input::placeholder,
.order-form input::placeholder,
.admin-form input::placeholder,
.admin-form textarea::placeholder,
.login-card input::placeholder,
.log-tools input::placeholder {
  color: #a8afbd;
  opacity: 1;
}
.select-control {
  height: 42px;
  padding: 0 12px;
  outline: 0;
  background: var(--bg-input);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  min-height: 280px;
}
.product-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  cursor: pointer;
}
.product-card::before {
  content: "";
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: .15s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.product-card:hover::before { opacity: 1; }
.product-media {
  display: grid;
  place-items: center;
  height: 150px;
  color: var(--accent-hover);
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  font-size: 46px;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: 18px;
}
.product-card h3 { margin: 0; font-size: 20px; }
.product-card p { margin: 0; color: var(--text-secondary); line-height: 1.5; }
.category-line { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: var(--radius-full); background: var(--accent); }
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.price { color: var(--accent-hover); font-weight: 800; font-size: 21px; }
.old-price { color: var(--text-muted); text-decoration: line-through; font-size: 13px; }
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-md);
  color: white;
  background: var(--accent-gradient);
  cursor: pointer;
  font-weight: 800;
}
.primary-btn:hover { filter: brightness(1.08); box-shadow: var(--shadow-glow); }
.full { width: 100%; }
.discount-badge, .featured-badge {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 5px 8px;
  border-radius: var(--radius-full);
  color: white;
  font-size: 12px;
  font-weight: 800;
}
.discount-badge { right: 12px; background: var(--danger); }
.featured-badge { left: 12px; background: var(--warning); }

.skeleton {
  min-height: 360px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--bg-card), var(--bg-card-hover), var(--bg-card));
  background-size: 220% 100%;
  animation: skeleton 1.15s infinite linear;
}
@keyframes skeleton { to { background-position: -220% 0; } }
.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 30px;
  color: var(--text-secondary);
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.empty-state i { color: var(--accent); font-size: 42px; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.pagination button {
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--bg-card);
  cursor: pointer;
}
.pagination button.active { color: white; border-color: var(--accent); background: var(--accent); }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.cart-dropdown {
  position: fixed;
  right: 24px;
  top: 74px;
  z-index: 350;
  width: min(380px, calc(100vw - 32px));
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-modal);
  box-shadow: var(--shadow-lg);
}
.cart-head, .cart-footer, .cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.cart-item small { display: block; color: var(--text-muted); margin-top: 4px; }
.cart-footer { border-bottom: 0; border-top: 1px solid var(--border); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.68);
  backdrop-filter: blur(4px);
}
.modal {
  width: min(700px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-modal);
  box-shadow: var(--shadow-lg);
  animation: pop .25s ease;
}
.modal.product-modal {
  width: min(980px, 100%);
}
@keyframes pop { from { opacity: 0; transform: scale(.95); } }
.modal-head, .modal-body, .modal-actions { padding: 20px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; }
.close-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--bg-input);
  cursor: pointer;
}
.feature-grid, .variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.product-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.product-info-pane {
  min-width: 0;
}
.buy-pane {
  position: sticky;
  top: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.buy-pane h3 { margin: 0; }
.variant-grid.compact {
  grid-template-columns: 1fr;
  max-height: 220px;
  overflow: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent), transparent 25%) rgba(255,255,255,.05);
}
.variant-grid.compact::-webkit-scrollbar {
  width: 8px;
}
.variant-grid.compact::-webkit-scrollbar-track {
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.05);
}
.variant-grid.compact::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg-card);
  border-radius: var(--radius-full);
  background: var(--accent);
}
.variant-grid.compact::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}
.order-form.compact {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.quantity-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.025);
}
.quantity-box small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
}
.quantity-control {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 8px;
}
.quantity-control button, .quantity-control input {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--bg-input);
}
.quantity-control button {
  cursor: pointer;
}
.quantity-control input {
  padding: 0 10px;
  text-align: center;
  outline: 0;
}
.feature, .variant-card {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.feature.highlight { border-color: var(--warning); }
.variant-card { cursor: pointer; }
.variant-card strong {
  color: var(--text-primary);
}
.variant-card p {
  margin: 5px 0 8px;
  color: #d6d8e1;
}
.variant-card .price {
  color: var(--accent-hover);
}
.variant-card.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent), transparent 88%); }
.variant-card:disabled {
  opacity: .72;
  cursor: not-allowed;
}
.variant-card:disabled strong,
.variant-card:disabled p {
  color: #aeb4c2;
}
.order-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.order-form input, .admin-form input, .admin-form textarea, .admin-form select, .login-card input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: 0;
  color: var(--text-primary);
  background: var(--bg-input);
}
.order-form input,
.admin-form input,
.admin-form textarea,
.admin-form select,
.login-card input,
.select-control,
.log-tools input,
.log-tools select {
  border-color: #2b3042;
}
.promo-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  display: grid;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: var(--radius-md);
  background: var(--bg-modal);
  box-shadow: var(--shadow-lg);
  animation: slideIn .2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { opacity: 0; transform: translateX(25px); } }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 40px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-secondary); }

.auth-page, .error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card, .error-page main {
  width: min(420px, 100%);
  padding: 42px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo { width: 56px; height: 56px; margin: 0 auto 18px; font-size: 23px; }
.login-card h1 { margin: 0; }
.login-card p { margin: 8px 0 26px; color: var(--text-muted); }
.login-card form { display: grid; gap: 15px; text-align: left; }
.login-card label { display: grid; gap: 8px; color: var(--text-secondary); font-size: 14px; }
.password-field { position: relative; display: block; }
.password-field button {
  position: absolute;
  right: 7px;
  top: 5px;
  width: 32px;
  height: 32px;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}
.form-error {
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--danger), transparent 60%);
  border-radius: var(--radius-md);
  color: #fecaca;
  background: rgba(239,68,68,.12);
  animation: shake .45s ease;
}
.form-hint {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: rgba(255,255,255,.03);
  line-height: 1.5;
}
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.back-link { display: inline-block; margin-top: 22px; color: var(--text-muted); }

.admin-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
}
.admin-nav { display: grid; gap: 6px; }
.admin-nav button, .admin-side-actions button, .admin-side-actions a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.admin-nav button.active, .admin-nav button:hover {
  border-color: var(--border);
  color: var(--text-primary);
  background: var(--bg-card);
}
.admin-side-actions { margin-top: auto; display: grid; gap: 6px; }
.admin-main { min-width: 0; }
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,11,15,.88);
  backdrop-filter: blur(16px);
}
#adminBurger { display: none; }
.admin-topbar h1 { margin: 0; font-size: 24px; }
.admin-topbar p { margin: 3px 0 0; color: var(--text-muted); }
.role-pill {
  margin-left: auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: var(--bg-card);
}
.status-toggle {
  min-width: 86px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--danger), transparent 55%);
  border-radius: var(--radius-full);
  color: #fecaca;
  background: rgba(239,68,68,.10);
  cursor: pointer;
  font-weight: 700;
}
.status-toggle.active {
  border-color: color-mix(in srgb, var(--success), transparent 55%);
  color: #bbf7d0;
  background: rgba(34,197,94,.10);
}
.status-toggle:hover { filter: brightness(1.15); }
.admin-content {
  display: grid;
  gap: 18px;
  padding: 24px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card, .admin-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.stat-card { padding: 18px; }
.stat-card span { color: var(--text-muted); }
.stat-card strong { display: block; margin-top: 8px; font-size: 28px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 { margin: 0; font-size: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--text-secondary); font-size: 13px; font-weight: 700; }
td code { font-family: "JetBrains Mono", monospace; color: var(--accent-hover); }
.row-actions { display: flex; gap: 6px; }
.mini-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: var(--bg-input);
  cursor: pointer;
}
.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-form label { display: grid; gap: 7px; color: var(--text-secondary); font-size: 13px; }
.admin-form .wide { grid-column: 1 / -1; }
.admin-filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.admin-filters input,
.admin-filters select {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #2b3042;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--bg-input);
  outline: 0;
}
.upload-field {
  grid-column: 1 / -1;
}
.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.upload-row .ghost-btn {
  min-height: 42px;
  white-space: nowrap;
}
.variant-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.025);
}
.variant-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.variant-editor-head strong { display: block; color: var(--text-primary); }
.variant-editor-head span {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}
.variant-editor-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 6px;
}
.variant-editor-row {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr 1fr .8fr 38px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.variant-editor-row label {
  min-width: 0;
}
.log-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.log-tools input, .log-tools select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--bg-input);
  outline: 0;
}
.logs-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.log-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.025);
  cursor: pointer;
  transition: .15s ease;
}
.log-card:hover,
.log-card:focus-visible {
  border-color: var(--accent);
  background: rgba(232,93,58,.08);
  outline: 0;
}
.log-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  color: var(--accent-hover);
  background: color-mix(in srgb, var(--accent), transparent 88%);
}
.log-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.log-title span, .log-main p {
  color: var(--text-secondary);
  font-size: 13px;
}
.log-main p { margin: 5px 0 0; }
.log-card code {
  color: var(--text-secondary);
  font-family: "JetBrains Mono", monospace;
}
.modal.log-modal {
  width: min(980px, 100%);
}
.log-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 14px;
  color: var(--text-secondary);
}
.diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.diff-grid section {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.diff-grid h3 {
  margin: 0 0 12px;
}
.diff-table {
  display: grid;
  gap: 8px;
  margin: 0;
}
.diff-table div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
}
.diff-table dt {
  color: var(--text-muted);
  font-weight: 700;
}
.diff-table dd {
  margin: 0;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.empty-state.compact {
  min-height: 90px;
  padding: 12px;
}
.orders-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.order-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.025);
}
.order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.order-top code {
  color: var(--accent-hover);
  font-family: "JetBrains Mono", monospace;
}
.order-top h3 {
  margin: 6px 0 4px;
  font-size: 19px;
}
.order-top p, .order-meta {
  color: var(--text-secondary);
  font-size: 13px;
}
.order-total {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.order-total strong {
  font-size: 22px;
  color: var(--text-primary);
}
.order-status {
  padding: 6px 10px;
  border-radius: var(--radius-full);
  color: #fde68a;
  background: rgba(245,158,11,.14);
  font-weight: 800;
  font-size: 12px;
}
.order-status.delivered, .order-status.success, .order-status.paid {
  color: #bbf7d0;
  background: rgba(34,197,94,.14);
}
.order-status.failed, .order-status.cancelled {
  color: #fecaca;
  background: rgba(239,68,68,.14);
}
.order-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.order-items span {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: var(--bg-input);
  font-size: 13px;
}
.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.order-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.modal.order-modal {
  width: min(860px, 100%);
}
.order-modal-body {
  display: grid;
  gap: 14px;
}
.order-modal-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.order-modal-section h3 {
  margin: 0;
}
.order-modal-items {
  display: grid;
  gap: 8px;
}
.order-modal-items div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
}
.order-modal-items span {
  color: var(--text-secondary);
  text-align: right;
}
.order-details {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.order-details summary {
  width: max-content;
  color: var(--accent-hover);
  cursor: pointer;
  font-weight: 800;
}
.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}
.delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.delivery-state-btn {
  position: relative;
}
.delivery-state-btn.delivery-active {
  border-color: var(--accent);
  color: white;
  background: color-mix(in srgb, var(--accent), transparent 72%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), white 20%), var(--shadow-glow);
}
.delivery-state-btn.delivery-active::after {
  content: "выбрано";
  margin-left: 6px;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 700;
}
.danger-action {
  border-color: color-mix(in srgb, var(--danger), transparent 35%);
  color: #fecaca;
}
.danger-action.delivery-active {
  border-color: var(--danger);
  background: rgba(239,68,68,.22);
  box-shadow: inset 0 0 0 1px rgba(254,202,202,.2);
}

.error-page main i { color: var(--accent); font-size: 54px; }
.error-page h1 {
  margin: 14px 0 0;
  font-size: 76px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  color: transparent;
}
.error-page p { color: var(--text-muted); }

@media (max-width: 1199px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-header {
    position: static;
    min-height: auto;
    padding: 12px 14px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  #adminEntryBtn.hidden + #copyIpBtn,
  #copyIpBtn {
    flex: 1;
    justify-content: center;
  }
  .catalog-head, .shop-hero { grid-template-columns: 1fr; }
  .catalog-head {
    position: static;
    padding: 14px 0;
    background: transparent;
  }
  .shop-hero { align-items: start; }
  .hero-status { justify-items: start; }
  .catalog-head { display: grid; }
  .catalog-controls { justify-content: flex-start; }
  body.admin-page,
  .admin-page {
    display: block;
    min-height: 100vh;
  }
  .admin-main {
    width: 100%;
    min-width: 0;
  }
  .admin-sidebar {
    position: fixed;
    z-index: 700;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    max-width: 100%;
    height: 100dvh;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .admin-sidebar.open { transform: translateX(0); }
  #adminBurger { display: grid; }
  .admin-content { padding: 12px; gap: 12px; }
  .admin-topbar {
    min-height: 60px;
    padding: 8px 12px;
    gap: 10px;
  }
  .admin-topbar h1 { font-size: 19px; }
  .admin-topbar p { font-size: 12px; }
  .role-pill { padding: 6px 9px; font-size: 12px; }
  .modal-backdrop { padding: 10px; align-items: start; }
  .modal { max-height: calc(100vh - 20px); }
}
@media (max-width: 599px) {
  .product-grid { grid-template-columns: 1fr; }
  .header-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .header-actions .ghost-btn {
    width: 100%;
    justify-content: center;
  }
  .header-actions .ghost-btn span { display: inline; }
  .brand { width: 100%; }
  .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
  .brand strong { font-size: 17px; }
  .shop-shell, .site-footer { width: min(100% - 20px, 1240px); }
  .promo-banner {
    width: min(100% - 20px, 1240px);
    margin-top: 10px;
    padding: 12px 40px 12px 14px;
    text-align: left;
  }
  .shop-hero {
    min-height: auto;
    padding: 22px;
  }
  .shop-hero h1 {
    font-size: 36px;
    line-height: 1.05;
  }
  .catalog-controls, .search-box, .select-control, .dropdown-filter, .filter-trigger { width: 100%; }
  .filter-menu {
    position: static;
    width: 100%;
    margin-top: 8px;
    max-height: 240px;
  }
  .feature-grid, .variant-grid, .admin-form, .stat-grid, .product-modal-body { grid-template-columns: 1fr; }
  .admin-filters { grid-template-columns: 1fr; }
  .admin-panel {
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  .panel-head {
    display: grid;
    align-items: start;
    padding: 12px;
  }
  .panel-head h2 {
    font-size: 16px;
  }
  .panel-head .primary-btn,
  .panel-head .ghost-btn,
  .log-tools,
  .log-tools input,
  .log-tools select {
    width: 100%;
  }
  .log-tools {
    display: grid;
    grid-template-columns: 1fr;
  }
  .table-wrap {
    overflow: visible;
  }
  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }
  table {
    min-width: 0;
  }
  thead {
    display: none;
  }
  tr {
    margin: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.025);
  }
  td {
    display: grid;
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    overflow-wrap: anywhere;
  }
  td:last-child {
    border-bottom: 0;
  }
  td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
  }
  .row-actions {
    justify-content: flex-end;
  }
  .status-toggle {
    min-width: 0;
    width: 100%;
  }
  .variant-editor-row { grid-template-columns: 1fr; }
  .variant-editor-head { display: grid; }
  .buy-pane { position: static; }
  .log-card { grid-template-columns: 42px minmax(0, 1fr); }
  .log-card code { grid-column: 2; }
  .log-title { display: grid; }
  .diff-grid { grid-template-columns: 1fr; }
  .diff-table div { grid-template-columns: 1fr; }
  .order-top { display: grid; }
  .order-total { justify-items: start; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .order-modal-items div { display: grid; }
  .order-modal-items span { text-align: left; }
  .order-card-actions .ghost-btn,
  .order-card-actions .primary-btn,
  .order-card-actions .danger-action {
    width: 100%;
    justify-content: center;
  }
  .site-footer { display: grid; }
}
