@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg:        #080a0f;
  --bg2:       #0d1018;
  --bg3:       #111520;
  --bg4:       #161b28;
  --bg5:       #1c2130;
  --border:    rgba(255,255,255,0.06);
  --border2:   rgba(255,255,255,0.10);
  --border3:   rgba(255,255,255,0.16);

  --red:       #e8001a;
  --red2:      #ff1a30;
  --red3:      #c0000d;
  --red-glow:  rgba(232,0,26,0.15);
  --red-glow2: rgba(232,0,26,0.25);
  --red-dim:   rgba(232,0,26,0.08);

  --green:     #00d97a;
  --green-dim: rgba(0,217,122,0.1);
  --green-glow:rgba(0,217,122,0.2);

  --text:      #e4e8f5;
  --text2:     rgba(228,232,245,0.55);
  --text3:     rgba(228,232,245,0.28);
  --text4:     rgba(228,232,245,0.12);

  --sidebar-w: 72px;
  --topbar-h:  58px;
  --radius:    10px;
  --radius-sm: 7px;
  --radius-lg: 14px;

  --font-main: 'Outfit', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --font-head: 'Rajdhani', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232,0,26,0.4); }

/* ════════════════════════════
   SIDEBAR
════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 20px;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  gap: 2px;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--red) 40%, var(--red) 60%, transparent);
  opacity: 0.2;
}

.sidebar-logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--red), #700008);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  font-family: var(--font-head);
  font-size: 14px; font-weight: 700;
  color: #fff; letter-spacing: 1px;
  box-shadow: 0 4px 20px var(--red-glow2), 0 0 0 1px rgba(232,0,26,0.3);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.sidebar-logo:hover {
  box-shadow: 0 6px 28px var(--red-glow2), 0 0 0 1px rgba(232,0,26,0.5);
  transform: translateY(-1px);
}

.nav-item {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text3);
  font-size: 17px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text2); }
.nav-item.active {
  background: var(--red-dim);
  color: var(--red2);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -1px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  background: linear-gradient(180deg, var(--red2), var(--red));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px var(--red);
}

.nav-tooltip {
  position: absolute; left: calc(100% + 12px);
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 11px; font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0; transform: translateX(-6px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 999;
  font-family: var(--font-head);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.nav-item:hover .nav-tooltip { opacity: 1; transform: translateX(0); }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* ════════════════════════════
   MAIN WRAP
════════════════════════════ */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ════════════════════════════
   TOPBAR
════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 22px; gap: 14px;
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(20px);
}

.topbar::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--red) 30%, var(--red) 70%, transparent 100%);
  opacity: 0.18;
}

.topbar-logo {
  font-family: var(--font-head);
  font-size: 20px; font-weight: 700;
  letter-spacing: 4px; color: var(--text);
  user-select: none;
  display: none;
}
.topbar-logo span { color: var(--red2); }

.tagline-main {
  font-family: var(--font-head);
  font-size: 15px; font-weight: 700;
  letter-spacing: 2px; color: var(--text);
  margin-right: auto;
}
.tagline-main em { color: var(--red2); font-style: normal; }
.tagline-sub {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text3);
  letter-spacing: 2px;
  display: none;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.steam-user {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius);
  height: 36px; padding: 0 12px;
  transition: border-color 0.2s;
}
.steam-user:hover { border-color: var(--border3); }
.steam-avatar { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; background: var(--bg4); }
.steam-name { font-size: 12px; color: var(--text2); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.balance-chip {
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,217,122,0.07);
  border: 1px solid rgba(0,217,122,0.2);
  border-radius: var(--radius);
  height: 36px; padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 13px; color: var(--green);
  letter-spacing: 0.5px; font-weight: 700;
}
.balance-chip::before { content: '$'; opacity: 0.5; margin-right: 1px; }

.history-btn {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius);
  height: 36px; padding: 0 14px;
  cursor: pointer; color: var(--text2);
  font-family: var(--font-head);
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; white-space: nowrap;
  transition: all 0.15s;
}
.history-btn:hover { border-color: var(--red); color: var(--red2); background: var(--red-dim); }

.history-count {
  background: var(--bg5); border: 1px solid var(--border2);
  border-radius: 5px; font-size: 10px; padding: 1px 7px;
  font-family: var(--font-mono); color: var(--text3);
}

.cart-btn {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(232,0,26,0.15), rgba(192,0,13,0.1));
  border: 1px solid rgba(232,0,26,0.4);
  border-radius: var(--radius);
  height: 36px; padding: 0 16px;
  cursor: pointer; color: var(--red2);
  font-family: var(--font-head);
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 0 14px var(--red-glow);
  transition: all 0.2s;
}
.cart-btn:hover {
  border-color: var(--red2);
  box-shadow: 0 0 22px var(--red-glow2);
  transform: translateY(-1px);
  color: #fff;
}
.cart-badge {
  background: var(--red); color: #fff;
  border-radius: 5px; font-size: 10px; font-weight: 700;
  padding: 1px 7px; font-family: var(--font-mono);
  display: none; box-shadow: 0 0 8px var(--red-glow2);
}
.cart-badge.visible { display: inline-block; }

/* ════════════════════════════
   LAYOUT
════════════════════════════ */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ════════════════════════════
   STORE PANEL
════════════════════════════ */
.store-panel {
  display: flex; flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.panel-head {
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; flex-shrink: 0;
  background: var(--bg2);
}
.panel-title {
  font-family: var(--font-head);
  font-size: 11px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--red2);
  display: flex; align-items: center; gap: 9px;
}
.panel-title::before {
  content: '';
  display: inline-block; width: 3px; height: 14px;
  background: linear-gradient(180deg, var(--red2), var(--red));
  border-radius: 2px;
  box-shadow: 0 0 8px var(--red2);
}
.item-count {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); background: var(--bg3);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 2px 9px;
}

/* ── FILTERS ── */
.filters-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 7px;
  flex-shrink: 0;
}

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--text3); font-size: 12px; pointer-events: none; }
.search-wrap input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  height: 36px; padding: 0 34px;
  color: var(--text);
  font-family: var(--font-main); font-size: 13px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap input:focus {
  border-color: rgba(232,0,26,0.5);
  box-shadow: 0 0 0 3px rgba(232,0,26,0.07);
}
.search-wrap input::placeholder { color: var(--text3); font-size: 12px; }
.search-clear {
  position: absolute; right: 9px;
  background: none; border: none;
  color: var(--text3); font-size: 13px;
  cursor: pointer; display: none;
  padding: 4px; border-radius: 4px;
  transition: color 0.15s;
}
.search-clear:hover { color: var(--red2); }
.search-clear.visible { display: flex; align-items: center; }

.filters-row {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.filter-label {
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text3); white-space: nowrap;
}
.price-input {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-mono); font-size: 11px;
  height: 30px; padding: 0 9px; width: 78px; outline: none;
  transition: border-color 0.2s;
}
.price-input:focus { border-color: rgba(232,0,26,0.4); }
.price-input::placeholder { color: var(--text3); }
.filter-sep { color: var(--text3); font-size: 11px; }

.filter-reset {
  margin-left: auto;
  background: none; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text3);
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; height: 30px; padding: 0 11px;
  cursor: pointer; transition: all 0.15s; text-transform: uppercase;
}
.filter-reset:hover { border-color: var(--red); color: var(--red2); }

.sort-row { display: flex; align-items: center; gap: 5px; overflow-x: auto; }
.sort-row::-webkit-scrollbar { display: none; }
.sort-label {
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text3); white-space: nowrap;
}
.sort-btn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text3);
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; padding: 0 11px; height: 26px;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  text-transform: uppercase; display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.sort-btn:hover { border-color: var(--red); color: var(--red2); }
.sort-btn.active {
  border-color: rgba(232,0,26,0.5); color: var(--red2);
  background: var(--red-dim);
  box-shadow: 0 0 10px var(--red-glow);
}
.sort-arrow { font-size: 9px; }

/* ════════════════════════════
   ITEMS GRID
════════════════════════════ */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 8px; padding: 12px;
  overflow-y: auto; flex: 1;
  align-content: start;
}

/* ── SKIN CARD ── */
.skin-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s, background 0.18s;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.skin-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
.skin-card:hover {
  border-color: rgba(232,0,26,0.5);
  background: #0f121c;
  box-shadow: 0 0 0 1px rgba(232,0,26,0.1), 0 8px 24px rgba(0,0,0,0.5);
  transform: translateY(-3px);
}
.skin-card.selected {
  border-color: var(--red);
  background: rgba(232,0,26,0.05);
  box-shadow: 0 0 0 1px rgba(232,0,26,0.2), 0 6px 20px rgba(232,0,26,0.12);
}
.skin-card.selected .skin-check { display: flex; }

.skin-check {
  display: none; position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  align-items: center; justify-content: center;
  z-index: 3; box-shadow: 0 0 10px var(--red-glow2);
}

.skin-img-wrap {
  width: 100%; height: 104px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #12151e 0%, #0c0f16 100%);
  flex-shrink: 0; position: relative; overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.skin-img-wrap::after {
  content: ''; position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.02) 0%, transparent 70%);
  pointer-events: none;
}
.skin-img {
  width: 80%; height: 80%;
  object-fit: contain;
  transition: transform 0.25s, filter 0.2s;
  display: block; position: relative; z-index: 1;
}
.skin-card:hover .skin-img { transform: scale(1.08); filter: drop-shadow(0 4px 12px rgba(232,0,26,0.2)); }
.skin-img-placeholder { font-size: 30px; color: var(--text3); }
.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(232,0,26,0.75) 0%, transparent 55%);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 9px;
  font-family: var(--font-head); font-size: 11px; font-weight: 700;
  letter-spacing: 2px; color: #fff; text-transform: uppercase;
  opacity: 0; transition: opacity 0.18s; pointer-events: none;
}
.skin-card:hover .card-overlay { opacity: 1; }

.skin-info {
  padding: 9px 11px 11px;
  display: flex; flex-direction: column; gap: 5px; flex: 1;
}
.skin-name {
  font-size: 11.5px; font-weight: 500; color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 30px;
}
.skin-price-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 1px; }
.skin-price {
  font-family: var(--font-mono); font-size: 14px; color: var(--red2); font-weight: 700;
}
.skin-steam-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(90,159,212,0.08); border: 1px solid rgba(90,159,212,0.2);
  border-radius: 4px; padding: 2px 6px;
  font-family: var(--font-mono); font-size: 9px; color: #5a9fd4;
  white-space: nowrap; width: fit-content; margin-top: 2px;
}
.skin-discount {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; display: inline-block;
}
.skin-discount.good { background: rgba(0,217,122,0.12); color: var(--green); border: 1px solid rgba(0,217,122,0.25); }
.skin-discount.ok   { background: rgba(255,136,0,0.12); color: #ff8800; border: 1px solid rgba(255,136,0,0.25); }
.skin-discount.meh  { background: rgba(255,255,255,0.05); color: var(--text3); border: 1px solid var(--border); }

/* ── PAGINATION ── */
.pagination {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  gap: 5px; padding: 16px 0 10px; flex-wrap: wrap;
}
.page-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-family: var(--font-mono); font-size: 11px;
  height: 30px; padding: 0 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s; min-width: 34px; text-align: center;
}
.page-btn:hover:not(:disabled) { border-color: var(--red); color: var(--red2); background: var(--red-dim); }
.page-btn:disabled { opacity: 0.3; cursor: default; }
.page-btn.active { border-color: var(--red); color: var(--red2); background: var(--red-dim); box-shadow: 0 0 10px var(--red-glow); }
.page-arrow {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-family: var(--font-head); font-size: 11px; font-weight: 700;
  height: 30px; padding: 0 14px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s; letter-spacing: 1px; text-transform: uppercase;
}
.page-arrow:hover:not(:disabled) { border-color: var(--red); color: var(--red2); background: var(--red-dim); }
.page-arrow:disabled { opacity: 0.3; cursor: default; }
.page-dots { color: var(--text3); font-size: 12px; padding: 0 3px; }

/* ════════════════════════════
   SELL PANEL (RIGHT)
════════════════════════════ */
.sell-panel {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg2);
}

.trade-section {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.section-label {
  font-family: var(--font-head); font-size: 11px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 9px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::before {
  content: ''; display: inline-block; width: 3px; height: 11px;
  background: linear-gradient(180deg, var(--red2), var(--red));
  border-radius: 2px; box-shadow: 0 0 6px var(--red);
  flex-shrink: 0;
}
.section-label-accent { color: var(--red2); }

.trade-input-row { display: flex; gap: 8px; margin-bottom: 9px; }
.trade-input-row input {
  flex: 1;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); height: 36px; padding: 0 12px;
  color: var(--text); font-family: var(--font-mono);
  font-size: 10px; outline: none; transition: border-color 0.2s;
  min-width: 0;
}
.trade-input-row input:focus { border-color: rgba(232,0,26,0.4); }
.trade-input-row input::placeholder { color: var(--text3); font-size: 9px; }

.btn-load {
  background: linear-gradient(135deg, var(--red), #900010);
  border: none; border-radius: var(--radius);
  height: 36px; padding: 0 16px; color: white;
  font-family: var(--font-head); font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap; box-shadow: 0 0 12px var(--red-glow);
}
.btn-load:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--red-glow2); }

.btn-find-trade {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 11px;
  background: transparent; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text2);
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-decoration: none; text-transform: uppercase;
  transition: all 0.15s;
}
.btn-find-trade:hover { border-color: var(--red); color: var(--red2); background: var(--red-dim); }

/* ── INVENTORY ── */
.inventory-section { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }

.inv-header {
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 38px; background: var(--bg2);
}
.inv-actions { display: flex; align-items: center; gap: 6px; }
.inv-sel-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text3);
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; padding: 0 9px; height: 24px;
  cursor: pointer; transition: all 0.15s; text-transform: uppercase;
}
.inv-sel-btn:hover { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.inv-sel-count { font-family: var(--font-mono); font-size: 11px; color: var(--text3); }
.inv-sel-count span { color: var(--green); }

.inv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 7px; padding: 10px;
  overflow-y: auto; flex: 1;
  align-content: start;
  max-height: calc(100vh - 320px);
}
.inventory-section .items-grid {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  align-content: start;
}

.inv-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  position: relative;
}
.inv-card:hover { border-color: var(--green); background: rgba(0,217,122,0.04); box-shadow: 0 0 10px var(--green-glow); }
.inv-card.selected { border-color: var(--green); background: rgba(0,217,122,0.06); box-shadow: 0 0 12px rgba(0,217,122,0.18); }
.inv-card.selected::after { content: '✓'; position: absolute; top: 4px; right: 5px; font-size: 9px; color: var(--green); font-weight: 700; }
.inv-card.no-price { opacity: 0.32; cursor: not-allowed; }
.inv-img-wrap {
  width: 100%; aspect-ratio: 1;
  background: #0f1117; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px; overflow: hidden;
}
.inv-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.inv-name { font-size: 9px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.inv-price { font-family: var(--font-mono); font-size: 10px; color: var(--green); }
.inv-no-price { font-size: 9px; color: var(--text3); }

/* ── SELL BAR ── */
.sell-bar {
  border-top: 1px solid var(--border);
  padding: 13px 16px; background: var(--bg2); flex-shrink: 0;
}
.sell-summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.sell-summary-label {
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--text3);
}
.sell-total {
  font-family: var(--font-mono); font-size: 20px; color: var(--green);
  font-weight: 700; text-shadow: 0 0 12px rgba(0,217,122,0.25);
}
.sell-items-count { font-size: 10px; color: var(--text3); margin-bottom: 11px; }

.btn-sell {
  width: 100%;
  background: linear-gradient(135deg, var(--green), #009a5e);
  border: none; border-radius: var(--radius); height: 40px;
  color: #000; font-family: var(--font-head);
  font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.btn-sell:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(0,217,122,0.3); }
.btn-sell:disabled { background: var(--bg4); color: var(--text3); cursor: not-allowed; box-shadow: none; transform: none; }

.btn-buy {
  width: 100%;
  background: linear-gradient(135deg, var(--red), #900010);
  border: none; border-radius: var(--radius); height: 40px;
  color: white; font-family: var(--font-head);
  font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 12px var(--red-glow);
}
.btn-buy:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--red-glow2); }
.btn-buy:disabled { background: var(--bg4); color: var(--text3); cursor: not-allowed; transform: none; box-shadow: none; }

/* ════════════════════════════
   SKIN PREVIEW
════════════════════════════ */
.skin-preview {
  position: fixed; z-index: 500; pointer-events: none;
  background: var(--bg3);
  border: 1px solid rgba(232,0,26,0.3);
  border-radius: var(--radius-lg); padding: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 0 24px var(--red-glow);
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.15s, transform 0.15s;
  width: 188px;
}
.skin-preview.visible { opacity: 1; transform: scale(1); }
.skin-preview img { width: 100%; height: 144px; object-fit: contain; display: block; margin-bottom: 10px; filter: drop-shadow(0 0 12px rgba(232,0,26,0.15)); }
.skin-preview-name { font-size: 11px; color: var(--text2); line-height: 1.4; margin-bottom: 5px; }
.skin-preview-price { font-family: var(--font-mono); font-size: 15px; color: var(--red2); font-weight: 700; }
.skin-preview-steam { font-family: var(--font-mono); font-size: 10px; color: var(--text3); margin-top: 2px; }
.skin-preview-disc { font-family: var(--font-mono); font-size: 11px; font-weight: 700; margin-top: 5px; }
.skin-preview-disc.good { color: var(--green); }
.skin-preview-disc.ok { color: #ff8800; }

/* ════════════════════════════
   CART DRAWER
════════════════════════════ */
.cart-drawer {
  position: fixed; top: var(--topbar-h); right: 0;
  width: 320px; height: calc(100vh - var(--topbar-h));
  background: var(--bg2); border-left: 1px solid var(--border);
  z-index: 200; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-title {
  font-family: var(--font-head); font-size: 12px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--text2);
}
.cart-close { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; transition: color 0.15s; }
.cart-close:hover { color: var(--text); }

.cart-items { flex: 1; overflow-y: auto; padding: 10px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 10px; color: var(--text3); font-size: 12px; }

.cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 7px;
  background: var(--bg3); transition: border-color 0.15s;
}
.cart-item:hover { border-color: var(--border2); }
.cart-item-img { width: 44px; height: 44px; object-fit: contain; background: var(--bg4); border-radius: 6px; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.cart-item-price { font-family: var(--font-mono); font-size: 11px; color: var(--red2); }
.cart-item-remove { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 12px; padding: 3px 5px; transition: color 0.15s; flex-shrink: 0; }
.cart-item-remove:hover { color: var(--red2); }

.cart-footer { border-top: 1px solid var(--border); padding: 14px 18px; }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.cart-total-label { font-size: 12px; color: var(--text3); }
.cart-total-sum { font-family: var(--font-mono); font-size: 19px; color: var(--red2); font-weight: 700; }

/* ════════════════════════════
   MODAL
════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 300;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 500px;
  max-width: 95vw; max-height: 80vh;
  display: flex; flex-direction: column;
  transform: translateY(18px); transition: transform 0.22s;
  box-shadow: 0 24px 70px rgba(0,0,0,0.85), 0 0 0 1px rgba(232,0,26,0.08);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-head {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-title { font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--text2); }
.modal-close { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; transition: color 0.15s; }
.modal-close:hover { color: var(--text); }
.modal-body { flex: 1; overflow-y: auto; padding: 10px 14px; }

.deal-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 7px;
  background: var(--bg3); transition: border-color 0.15s;
}
.deal-row:hover { border-color: var(--border2); }
.deal-type {
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; padding: 3px 9px; border-radius: 4px; flex-shrink: 0;
}
.deal-type.sell { background: rgba(0,217,122,0.1); color: var(--green); border: 1px solid rgba(0,217,122,0.25); }
.deal-type.buy  { background: var(--red-dim); color: var(--red2); border: 1px solid rgba(232,0,26,0.25); }
.deal-info { flex: 1; min-width: 0; }
.deal-id { font-family: var(--font-mono); font-size: 10px; color: var(--text3); margin-bottom: 2px; }
.deal-items-list { font-size: 10px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-right { text-align: right; flex-shrink: 0; }
.deal-amount { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.deal-amount.sell { color: var(--green); }
.deal-amount.buy  { color: var(--red2); }
.deal-status { font-size: 9px; margin-top: 2px; }
.deal-status.ok      { color: var(--green); }
.deal-status.fail    { color: var(--red2); }
.deal-status.pending { color: var(--text3); }
.deal-date { font-size: 9px; color: var(--text3); margin-top: 2px; }
.history-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 20px; color: var(--text3); font-size: 12px; }

/* ════════════════════════════
   UTILS
════════════════════════════ */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: var(--text3); padding: 40px 20px;
}
.empty-icon { font-size: 34px; opacity: 0.3; }
.empty-state p { font-size: 12px; text-align: center; line-height: 1.65; max-width: 210px; }

.loading-state {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 12px; color: var(--text3); font-size: 13px;
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--red); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 28px;
  left: 50%; transform: translateX(-50%) translateY(18px);
  background: var(--bg4); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 11px 24px;
  font-size: 13px; color: var(--text);
  opacity: 0; transition: all 0.25s; z-index: 999;
  pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(0,217,122,0.4); color: var(--green); box-shadow: 0 0 20px rgba(0,217,122,0.1); }
.toast.error   { border-color: rgba(232,0,26,0.4); color: var(--red2); box-shadow: 0 0 20px var(--red-glow); }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, #13161f 50%, var(--bg3) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 5px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; }
.skeleton-img  { width: 100%; aspect-ratio: 1; margin-bottom: 9px; border-radius: var(--radius); }
.skeleton-line  { height: 10px; margin-bottom: 7px; width: 80%; }
.skeleton-price { height: 12px; width: 50%; }

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2); border-top: 1px solid var(--border);
  z-index: 300;
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
  justify-content: space-around; align-items: center;
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text3); cursor: pointer;
  padding: 4px 10px; border-radius: 8px;
  transition: color 0.15s; min-width: 56px;
}
.mobile-nav-item svg { flex-shrink: 0; }
.mobile-nav-item span {
  font-family: var(--font-head); font-size: 9px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
}
.mobile-nav-item.active { color: var(--red2); }

/* ════════════════════════════
   RESPONSIVE
════════════════════════════ */

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr !important; height: auto; overflow: visible; }
  .store-panel { border-right: none; height: auto; }
  .sell-panel { height: auto; border-top: 1px solid var(--border); }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 7px; padding: 8px; }
  .skin-img-wrap { height: 86px; }
}

@media (max-width: 720px) {
  :root { --sidebar-w: 0px; --topbar-h: 52px; }

  html, body { overflow-x: hidden; max-width: 100vw; }
  .sidebar { display: none; }
  .main-wrap { margin-left: 0; width: 100%; overflow-x: hidden; }
  .mobile-nav { display: flex; }

  /* Топбар компактный */
  .topbar { padding: 0 12px; gap: 6px; height: var(--topbar-h); overflow: hidden; }
  .topbar-logo { display: block; font-size: 16px; letter-spacing: 2px; flex-shrink: 0; }
  .tagline-main { display: none; }
  .topbar-right { gap: 6px; flex-shrink: 0; margin-left: auto; }
  .history-btn { padding: 0 10px; height: 32px; font-size: 10px; }
  .history-btn .history-btn-label { display: none; }
  .balance-chip { padding: 0 10px; height: 32px; font-size: 12px; }
  .cart-btn { padding: 0 12px; height: 32px; }
  .cart-btn .cart-btn-text { display: none; }

  /* Layout */
  .layout { grid-template-columns: 1fr !important; height: auto; padding-bottom: 70px; overflow: visible; }
  #sellPanelWrap { display: none; }
  #sellPanelWrap.mobile-visible { display: flex; }

  .store-panel { border-right: none; overflow: visible; height: auto; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; padding: 8px; overflow-y: visible; height: auto; }
  .skin-img-wrap { height: 78px; }

  /* Filters */
  .filters-bar { padding: 8px 10px; gap: 6px; }
  .price-input { width: 66px; }
  .sort-btn { padding: 0 8px; font-size: 9px; }
  .panel-head { padding: 0 12px; min-height: 40px; }

  /* Inventory */
  .inv-grid { grid-template-columns: repeat(4, 1fr); }
  .cart-drawer { width: 100%; top: var(--topbar-h); height: calc(100vh - var(--topbar-h) - 70px); }
}

@media (max-width: 420px) {
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 5px; padding: 6px; }
  .skin-img-wrap { height: 68px; }
  .skin-name { font-size: 10.5px; }
  .skin-price { font-size: 12px; }
  .inv-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar-logo { font-size: 14px; }
  .history-count { display: none; }
}
/* ── LANG SWITCH ── */
.lang-switch {
  display: flex;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  height: 36px;
  overflow: hidden;
  flex-shrink: 0;
}
.lang-btn {
  background: none;
  border: none;
  height: 100%;
  padding: 0 11px;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}
.lang-btn:hover { color: var(--text2); }
.lang-btn.active {
  background: var(--red-dim);
  color: var(--red2);
  box-shadow: inset 0 0 8px var(--red-glow);
}
.lang-sep {
  width: 1px;
  height: 18px;
  background: var(--border2);
  flex-shrink: 0;
}
