/* build:202606270814 */
:root {
  --bg: #0e0f13;
  --surface: #16181f;
  --surface2: #1e2028;
  --border: #2a2d38;
  --accent: #c8f04a;
  --accent2: #7ee8a2;
  --text: #f0f0ee;
  --muted: #7a7d8a;
  --danger: #ff5c5c;
  --radius: 14px;
  --radius-sm: 8px;
  --font-sans: 'PF Square Sans Pro', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 15px; font-weight: 400; min-height: 100vh; -webkit-font-smoothing: antialiased; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--surface); border-right: 1px solid var(--border); padding: 28px 0; display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; }
.main { margin-left: 240px; flex: 1; min-width: 0; width: calc(100% - 240px); max-width: none; padding: 36px clamp(16px, 3vw, 40px); padding-bottom: 100px; }
.logo { font-family: var(--font-sans); font-size: 15px; font-weight: 700; color: var(--accent); padding: 0 24px 28px; letter-spacing: -.02em; border-bottom: 1px solid var(--border); }
.logo span { color: var(--muted); font-weight: 400; }
.nav { padding: 16px 0; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(167, 139, 250, 0.28) transparent; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.22);
  border-radius: 999px;
}
.nav::-webkit-scrollbar-thumb:hover { background: rgba(167, 139, 250, 0.42); }
.nav::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
.nav-section { font-size: 10px; letter-spacing: .1em; color: var(--muted); padding: 12px 24px 6px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 24px; cursor: pointer; color: var(--muted); transition: all .15s; border-left: 2px solid transparent; font-weight: 400; font-size: 14px; }
.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(200,240,74,.06); }
.nav-item.nav-theme-row {
  cursor: default;
  user-select: none;
}
.nav-item.nav-theme-row:hover {
  color: var(--muted);
  background: transparent;
}
.nav-icon { width: 18px; text-align: center; flex-shrink: 0; }
.badge { background: var(--accent); color: #0e0f13; font-size: 10px; font-weight: 600; border-radius: 10px; padding: 1px 7px; margin-left: auto; font-family: var(--font-sans); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 20px; }
.status.open { background: rgba(200,240,74,.15); color: var(--accent); }
.status.closed { background: rgba(255,92,92,.12); color: var(--danger); }
.status.transit { background: rgba(126,232,162,.12); color: var(--accent2); }
.status.paid { background: rgba(160,196,255,.12); color: #a0c4ff; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.page-title { font-family: var(--font-sans); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .2s, transform .15s; display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.product-card.in-order { border-color: rgba(200,240,74,.45); box-shadow: inset 0 0 0 1px rgba(200,240,74,.15); }
.product-card-qty {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border); margin-top: auto;
  background: var(--surface2);
}
.product-card-qty .qty-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 20px; font-weight: 700;
  cursor: pointer; font-family: inherit; line-height: 1; flex-shrink: 0;
}
.product-card-qty .qty-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.product-card-qty .qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.product-card-qty .qty-num { font-weight: 700; font-size: 15px; min-width: 28px; text-align: center; color: var(--accent); }
.product-card-qty .qty-num.zero { color: var(--muted); font-weight: 500; }
.qty-num-input {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  min-width: 28px;
  width: 40px;
  max-width: 52px;
  padding: 2px 4px;
  text-align: center;
  color: var(--accent);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
}
.qty-num-input.zero { color: var(--muted); font-weight: 500; }
.qty-num-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--text);
}
.qty-control .qty-num-input { font-weight: 600; min-width: 24px; width: 36px; }
.supplier-rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.supplier-rate-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.supplier-rate-card .form-label { font-size: 11px; margin-bottom: 4px; }
.supplier-rate-card .form-input { padding: 8px 10px; font-size: 13px; }
.admin-bulk-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  background: rgba(200,240,74,.08); border: 1px solid rgba(200,240,74,.25);
  border-radius: var(--radius-sm);
}
.admin-bulk-bar.hidden { display: none !important; }
.table th input[type="checkbox"], .table td input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.order-expand-btn {
  width: 28px; height: 28px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 11px; line-height: 1;
  font-family: inherit;
}
.order-expand-btn:hover { border-color: var(--accent); color: var(--accent); }
.order-expand-btn.expanded { transform: rotate(90deg); }
.admin-order-client { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-order-detail-row td { background: var(--surface2); padding: 8px 12px 14px !important; border-bottom: 1px solid var(--border); }
.order-items-subtable { width: 100%; font-size: 13px; border-collapse: collapse; }
.order-items-subtable th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.order-items-subtable td { padding: 10px; vertical-align: middle; border-bottom: 1px solid rgba(255,255,255,.04); }
.order-items-subtable tr:last-child td { border-bottom: none; }
.order-items-subtable .order-items-price-cell { line-height: 1.4; white-space: nowrap; }
.order-items-subtable .order-items-price-cell .order-price-old {
  display: inline;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
}
.product-card { content-visibility: auto; contain-intrinsic-size: auto 300px; }
.product-img { width: 100%; aspect-ratio: 1; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 48px; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-img.product-img--nophoto img,
.product-img--nophoto img,
.wh-thumb--nophoto { object-fit: contain; background: #fff; }
.product-img.product-img--placeholder { font-size: 48px; }
.catalog-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(8, 6, 14, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, 3vw);
  cursor: zoom-out;
}
.catalog-image-lightbox.hidden { display: none; }
.catalog-image-lightbox img {
  max-width: min(96vw, 960px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.modal-product-photo {
  text-align: center;
  margin-bottom: 16px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}
.modal-product-photo.catalog-zoomable { cursor: zoom-in; }
.modal-product-photo img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.modal-product-photo.product-img--nophoto img {
  max-height: 180px;
  background: #fff;
  padding: 8px;
}
.product-info { padding: 14px; }
.product-brand { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.product-name { font-weight: 500; font-size: 14px; margin-bottom: 4px; line-height: 1.3; }
.product-variant { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.product-price { font-family: var(--font-sans); font-size: 16px; font-weight: 600; color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; font-family: var(--font-sans); }
.btn-primary { background: var(--accent); color: #0e0f13; }
.btn-primary:hover { background: #d8ff50; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-danger { background: rgba(255,92,92,.12); color: var(--danger); border: 1px solid rgba(255,92,92,.2); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }
.order-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.order-item:last-child { border-bottom: none; }
.order-item-check { flex-shrink: 0; display: flex; align-items: center; }
.order-item-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.order-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.order-toolbar.hidden { display: none !important; }
.order-select-all {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
  cursor: pointer; user-select: none;
}
.order-emoji { width: 48px; height: 48px; background: var(--surface2); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; overflow: hidden; }
.order-emoji img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-emoji.order-emoji--nophoto img { object-fit: contain; background: #fff; }
.order-info { flex: 1; min-width: 0; }
.order-name { font-weight: 500; font-size: 14px; }
.order-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.qty-control { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.qty-btn { width: 28px; height: 28px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all .15s; }
.qty-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-val { font-weight: 600; font-size: 15px; min-width: 24px; text-align: center; font-family: var(--font-sans); }
.order-price { font-family: var(--font-sans); font-size: 15px; font-weight: 600; color: var(--accent); min-width: 90px; text-align: right; flex-shrink: 0; line-height: 1.3; }
.order-price-old { display: block; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: line-through; font-family: inherit; margin-top: 2px; }
.product-price-old { font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: line-through; margin-left: 6px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-family: var(--font-sans); font-size: 24px; font-weight: 600; }
.stat-value.green { color: var(--accent); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table th { text-align: left; padding: 10px 14px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); font-weight: 500; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface2); }
.filter-row { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.filter-chip { padding: 7px 16px; border-radius: 20px; border: 1px solid var(--border); font-size: 13px; cursor: pointer; color: var(--muted); transition: all .15s; background: transparent; font-family: var(--font-sans); }
.filter-chip:hover { border-color: var(--muted); color: var(--text); }
.filter-chip.active { background: var(--accent); color: #0e0f13; border-color: var(--accent); font-weight: 600; }
.filter-chip-check { display: inline-flex; align-items: center; cursor: pointer; user-select: none; }
.filter-chip-check.active { background: var(--accent-muted); color: var(--accent-bright); border-color: var(--border-strong); font-weight: 600; }
.search-box { flex: 1; max-width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; color: var(--text); font-family: var(--font-sans); font-size: 14px; outline: none; }
.search-box:focus { border-color: var(--accent); }
.form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: block; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.form-input { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text); font-family: var(--font-sans); font-size: 14px; outline: none; }
.form-input:focus { border-color: var(--accent); }
.profit-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; gap: 12px; }
.profit-line:last-child { border-bottom: none; }
.profit-total { font-family: var(--font-sans); font-size: 20px; font-weight: 700; color: var(--accent); }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; width: 480px; max-width: 96vw; max-height: 90vh; overflow-y: auto; }
.modal-title { font-family: var(--font-sans); font-size: 17px; font-weight: 600; margin-bottom: 20px; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--surface2); border: 1px solid var(--accent); color: var(--accent); padding: 12px 20px; border-radius: var(--radius-sm); font-weight: 500; font-size: 14px; z-index: 999; transform: translateY(80px); opacity: 0; transition: all .3s; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: var(--danger); color: var(--danger); }
.order-bar { position: fixed; bottom: 0; left: 240px; right: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 16px 40px; display: none; align-items: center; justify-content: space-between; z-index: 50; }
.order-bar.visible { display: flex; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #0e0f13; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.section { margin-bottom: 32px; }
.section-title { font-family: var(--font-sans); font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sidebar-bottom { padding: 8px 12px 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 60; }
.user-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-info { flex: 1; min-width: 0; }
.sidebar-bottom .avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.user-name { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout { flex-shrink: 0; margin-left: auto; }

/* Тумблер темы — в сайдбаре или плавающий на auth-страницах */
.theme-switch--nav {
  position: static;
  flex-shrink: 0;
  margin-left: auto;
  filter: none;
  z-index: auto;
}
.theme-switch--nav:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.2));
}
.theme-switch--nav:active {
  transform: scale(0.98);
}

.theme-switch:not(.theme-switch--nav) {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 120;
}
.theme-switch {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.28));
  transition: transform 0.15s, filter 0.2s;
}
.theme-switch:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 22px rgba(124, 58, 237, 0.35));
}
.theme-switch:active {
  transform: scale(0.98);
}
.theme-switch-track {
  display: block;
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, #120a22 0%, #312e81 42%, #6366f1 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  overflow: hidden;
  transition: background 0.35s ease, border-color 0.35s ease;
}
[data-theme="light"] .theme-switch-track {
  background: linear-gradient(90deg, #ddd6fe 0%, #fde68a 52%, #fbbf24 100%);
  border-color: rgba(91, 33, 182, 0.18);
}
.theme-switch-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.25s;
}
.theme-switch-icon-moon { left: 6px; opacity: 0.95; }
.theme-switch-icon-sun { right: 5px; opacity: 0.9; }
[data-theme="light"] .theme-switch-icon-moon { opacity: 0.55; }
[data-theme="light"] .theme-switch-icon-sun { opacity: 1; }
[data-theme="dark"] .theme-switch-icon-moon,
:root:not([data-theme="light"]) .theme-switch-icon-moon { opacity: 1; }
[data-theme="dark"] .theme-switch-icon-sun,
:root:not([data-theme="light"]) .theme-switch-icon-sun { opacity: 0.55; }
.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ede9fe, #c4b5fd);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.32s cubic-bezier(0.34, 1.35, 0.64, 1), background 0.35s ease;
}
[data-theme="light"] .theme-switch-thumb {
  transform: translateX(22px);
  background: linear-gradient(145deg, #fffbeb, #fde68a);
  box-shadow: 0 1px 6px rgba(180, 130, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body:has(.order-bar.visible) .theme-switch:not(.theme-switch--nav) {
  bottom: 72px;
}

.theme-fab {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface, var(--surface2));
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, border-color 0.2s;
}
.theme-fab:hover {
  transform: scale(1.05);
  border-color: var(--accent-bright, var(--accent));
}

.legal-page {
  min-height: 100vh;
  padding: 48px 20px 64px;
}
.legal-page-inner {
  max-width: 720px;
  margin: 0 auto;
}
.legal-back {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.legal-back:hover { color: var(--accent-bright, var(--accent)); }
.legal-title {
  font-family: var(--font-sans);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}
.legal-lead {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 28px;
  padding: 16px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.legal-section {
  margin-bottom: 28px;
}
.legal-section h2 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.legal-section p,
.legal-section li {
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 10px;
}
.legal-section ul {
  padding-left: 20px;
  margin: 8px 0 12px;
}
.legal-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
.legal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.legal-foot a {
  color: var(--accent-bright, var(--accent));
  text-decoration: none;
  font-weight: 600;
}
.legal-foot a:hover { text-decoration: underline; }
.legal-foot span { color: var(--muted); }

.input-prefix-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.input-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 0 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text);
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  flex-shrink: 0;
}
.input-with-prefix {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}
.input-prefix-wrap:focus-within .input-prefix,
.input-prefix-wrap:focus-within .input-with-prefix {
  border-color: var(--accent);
}

.phone-input-wrap {
  display: flex;
  gap: 8px;
  width: 100%;
}
.phone-country-select {
  width: auto;
  min-width: 118px;
  flex-shrink: 0;
  padding-left: 10px;
  padding-right: 8px;
}
.phone-national-input {
  flex: 1;
  min-width: 0;
}

.sidebar-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.2;
}
.sidebar-legal a {
  color: var(--muted);
  text-decoration: none;
}
.sidebar-legal a:hover {
  color: var(--accent-bright);
}

.auth-legal-links {
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  line-height: 1.45;
}
.auth-legal-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  cursor: pointer;
}
.auth-legal-check input {
  margin-top: 3px;
  flex-shrink: 0;
}
.auth-legal-check a {
  color: var(--accent-bright);
}
.order-row { background: var(--surface2); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hidden { display: none !important; }
body.role-client .main > [id^="page-admin-"] { display: none !important; }
.import-log {
  margin-top: 10px;
  max-height: 140px;
  overflow-y: auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}
.import-log-line { color: var(--muted); }
.import-log-line.warn { color: var(--warning, #e8b84a); }
.import-log-line.error { color: var(--danger); }
.import-log-line.ok { color: var(--accent2); }
.import-progress-active #btn-run-import { opacity: 0.7; pointer-events: none; }
.bonus-chip { background: rgba(200,240,74,.12); color: var(--accent); border-radius: 20px; padding: 4px 14px; font-size: 13px; font-weight: 700; border: 1px solid rgba(200,240,74,.2); }
.status-flow { display: flex; gap: 8px; flex-wrap: wrap; }
.status-step { padding: 7px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-family: inherit; background: transparent; }
.status-step:hover { border-color: var(--muted); color: var(--text); }
.batch-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.batch-list-row { display: flex; align-items: stretch; gap: 8px; }
.batch-list-row .batch-list-item { flex: 1; min-width: 0; }
.batch-list-row .btn-set-active-batch { flex-shrink: 0; align-self: center; white-space: nowrap; }
.batch-list-item { display: block; width: 100%; text-align: left; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; color: var(--text); font-family: inherit; transition: border-color .15s; }
.batch-list-item:hover { border-color: var(--muted); }
.batch-list-item.viewing { border-color: var(--muted); background: rgba(255,255,255,.03); }
.batch-list-item.is-active-work { box-shadow: inset 3px 0 0 var(--accent); }
.batch-list-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.batch-list-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.history-row:hover { border-color: var(--accent) !important; }
.history-order-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.history-order-item:last-child { border-bottom: none; padding-bottom: 0; }
.history-order-item:first-child { padding-top: 0; }
.history-order-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.history-order-item-name { flex: 1; min-width: 0; font-weight: 600; line-height: 1.35; }
.history-order-item-sum {
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
  line-height: 1.35;
  font-family: var(--font-sans);
  color: var(--accent);
}
.history-order-item-unit {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
}
.history-order-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  gap: 12px;
}
#history-order-discount { margin-bottom: 4px; }
.history-order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 8px;
  gap: 12px;
}
.history-order-total-row #history-order-total {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  text-align: right;
}
.status-step.done { background: rgba(126,232,162,.1); color: var(--accent2); border-color: rgba(126,232,162,.3); }
.status-step.current { background: rgba(200,240,74,.15); color: var(--accent); border-color: var(--accent); }
.lock-notice { background: rgba(255,92,92,.08); border: 1px solid rgba(255,92,92,.2); border-radius: var(--radius-sm); padding: 12px 16px; color: var(--danger); font-size: 13px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-wide { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.loading-screen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 500; font-family: var(--font-sans); color: var(--accent); transition: opacity 0.22s ease; }
.loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.catalog-loading { grid-column: 1 / -1; padding: 48px 0; text-align: center; color: var(--muted); font-size: 14px; }

.support-contacts { display: flex; flex-direction: column; gap: 10px; }
.support-contact-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface2);
  text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s;
}
.support-contact-card:hover { border-color: var(--accent); background: var(--accent-muted, rgba(200, 240, 74, 0.08)); }
.support-contact-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.support-contact-title { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 2px; }
.support-contact-value { display: block; font-size: 15px; font-weight: 600; color: var(--accent); word-break: break-all; }
.support-ticket-item {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
}
.support-ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.support-ticket-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  font: inherit;
  color: inherit;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, background 0.15s;
}
.support-ticket-btn:hover { border-color: var(--accent); }
.support-thread { display: flex; flex-direction: column; gap: 12px; max-height: 50vh; overflow-y: auto; padding-right: 4px; }
.support-thread-msg {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
}
.support-thread-msg.is-staff {
  background: rgba(200, 240, 74, 0.08);
  border-color: rgba(200, 240, 74, 0.25);
}
.support-thread-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--muted);
}
.support-thread-meta strong { color: var(--text); font-size: 13px; }
.support-thread-body { font-size: 14px; line-height: 1.5; word-break: break-word; }
.batch-list-item.viewing { border-color: var(--accent); background: var(--accent-muted, rgba(200, 240, 74, 0.1)); }
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }

.main .card:has(> .table),
.main .card:has(.table) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 960px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    padding: 0 14px;
    z-index: 180;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }
  .nav-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
  }
  .mobile-topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .app.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    width: min(288px, 88vw);
    transform: translateX(-105%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 200;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .main {
    margin-left: 0;
    width: 100%;
    padding: 68px 16px 100px;
  }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header .btn, .page-header .search-box { width: 100%; max-width: none; }
  .catalog-toolbar { flex-direction: column; align-items: stretch; }
  .catalog-filters { flex-direction: column; }
  .filter-row { flex-wrap: wrap; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .stats-row, .grid-2, .grid-2-wide { grid-template-columns: 1fr; }
  .order-bar { left: 0; padding: 14px 16px; }
  .table-wrap, .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .theme-switch:not(.theme-switch--nav) { bottom: 14px; right: 14px; }
  body:has(.order-bar.visible) .theme-switch:not(.theme-switch--nav) { bottom: 68px; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .product-card .card-actions { flex-wrap: wrap; }
}
