.economy-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  color: #e8e8ea;
  position: relative;
  z-index: 1;
}
.economy-page h1 {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}
.economy-page .lead {
  color: #9a9aa3;
  margin-bottom: 1.5rem;
}
.economy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.economy-card {
  background: rgba(28, 28, 30, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.economy-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #0a0a0a;
  border-radius: 12px;
}
.economy-card h3 {
  font-size: 1rem;
  margin: 0;
}
.economy-meta {
  font-size: 0.85rem;
  color: #a0a0a8;
}
.economy-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.economy-btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: #0A84FF;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
.economy-btn.secondary {
  background: rgba(255,255,255,0.08);
}
.economy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.economy-toast {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(10,132,255,0.15);
  border: 1px solid rgba(10,132,255,0.35);
}
.economy-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.economy-form input, .economy-form select {
  background: #1c1c1e;
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
}
.rarity-milspec { color: #4b69ff; }
.rarity-restricted { color: #8847ff; }
.rarity-classified { color: #d32ce6; }
.rarity-covert { color: #eb4b4b; }
.rarity-extraordinary { color: #eb4b4b; }
.kronos-coin {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-right: 4px;
}

/* Keep header right controls clickable when many nav links are present */
body:not(.admin-page) .navbar.navbar-custom .ms-auto,
body:not(.admin-page) .navbar.navbar-custom .theme-cluster {
  position: relative;
  z-index: 20250 !important;
  flex-shrink: 0 !important;
  pointer-events: auto !important;
}
body:not(.admin-page) .navbar.navbar-custom #mainNavbar {
  min-width: 0;
  overflow: visible;
}
body:not(.admin-page) .navbar.navbar-custom .navbar-nav {
  flex-wrap: wrap;
  max-width: 100%;
}

.economy-page--wide {
  max-width: 1280px;
}
.skin-index-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.skin-index-tab {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #c8c8d0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}
.skin-index-tab.is-active {
  background: #0A84FF;
  border-color: #0A84FF;
  color: #fff;
}
.skin-index-panel { display: none; }
.skin-index-panel.is-active { display: block; }
.skin-index-filters {
  align-items: center;
  margin-bottom: 18px;
}
.skin-index-filters input[type="search"] {
  min-width: min(100%, 280px);
  flex: 1;
}
.skin-index-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.skin-index-card.is-missing-image {
  border-color: rgba(255, 159, 10, 0.45);
}
.skin-flag { font-weight: 600; }
.skin-flag--ok { color: #30d158; }
.skin-flag--warn { color: #ff9f0a; }
.skin-flag--bad { color: #ff453a; }
.economy-meta code {
  font-size: 0.8em;
  color: #d0d0d8;
}

/* ===== CS2-style inventory ===== */
.inv-cs2-page,
.economy-page.inv-cs2-page {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  padding-left: clamp(12px, 1.5vw, 28px);
  padding-right: clamp(12px, 1.5vw, 28px);
}
.inv-cs2-header .lead {
  margin-bottom: 1rem;
}
.inv-cs2-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.inv-cs2-toolbar input[type="search"] {
  background: #1a1f24;
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 4px;
  padding: 8px 12px;
  min-width: min(100%, 260px);
}
.inv-cs2-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9aa3ad;
  font-size: 0.9rem;
}
.inv-cs2-sort select {
  background: #1a1f24;
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 4px;
  padding: 8px 10px;
  min-width: 180px;
}
.inv-cs2-new {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  background: #cf6a32;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  pointer-events: none;
}
.inv-cs2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  background: rgba(12, 16, 20, 0.55);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 12px;
  border-radius: 4px;
  min-height: 280px;
  width: 100%;
}
.inv-cs2-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #1a1a1b;
  border: 0;
  border-radius: 2px;
  padding: 0;
  text-align: left;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  min-height: 220px;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.inv-cs2-card:hover,
.inv-cs2-card:focus-visible {
  outline: none;
  filter: brightness(1.08);
  z-index: 2;
}
.inv-cs2-card__media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px 10px;
  min-height: 140px;
  background: linear-gradient(180deg, #4a4a4a 0%, #6e6e6e 55%, #7a7a7a 100%);
}
.inv-cs2-card__media img {
  max-width: 100%;
  max-height: 124px;
  object-fit: contain;
  pointer-events: none;
}
.inv-cs2-card__rarity {
  height: 3px;
  width: 100%;
  background: var(--rarity, #4b69ff);
  flex-shrink: 0;
}
.inv-cs2-card__meta {
  padding: 8px 10px 10px 12px;
  background: #1a1a1b;
}
.inv-cs2-card__weapon {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-cs2-card__weapon.is-stattrak,
.inv-cs2-tip__title.is-stattrak,
#invInspectName.is-stattrak,
.stattrak-label {
  color: #cf6a32 !important;
}
.stattrak-label {
  font-weight: 700;
}
.inv-cs2-card__pattern {
  font-size: 0.78rem;
  font-weight: 400;
  color: #ffffff;
  opacity: 0.92;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-cs2-equipped {
  position: absolute;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35);
  z-index: 4;
}
.inv-cs2-equipped::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.95;
}
.inv-cs2-equipped--t {
  right: 8px;
  background: #ff7a18;
}
.inv-cs2-equipped--ct {
  right: 8px;
  background: #1a9fff;
}
.inv-cs2-card:has(.inv-cs2-equipped--t):has(.inv-cs2-equipped--ct) .inv-cs2-equipped--t {
  right: 26px;
}
.inv-cs2-ctx__item.is-on {
  color: #9ad1ff;
}
.inv-cs2-locked {
  position: absolute;
  top: 8px;
  left: 12px;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  background: rgba(0,0,0,0.55);
  color: #ffd60a;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  z-index: 4;
}

.inv-cs2-tip,
.inv-cs2-ctx {
  position: fixed;
  z-index: 50000;
  pointer-events: none;
}
.inv-cs2-tip {
  width: min(320px, calc(100vw - 24px));
  background: rgba(27, 30, 33, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 0;
  color: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.inv-cs2-tip__head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, #2a2e33 0%, #1b1e21 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.inv-cs2-tip__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
}
.inv-cs2-tip__titles {
  min-width: 0;
}
.inv-cs2-tip__title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 2px;
  line-height: 1.25;
  color: #fff;
}
.inv-cs2-tip__collection {
  color: #c8ccd0;
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.3;
}
.inv-cs2-tip__body {
  padding: 10px 14px 12px;
  background: #1b1e21;
}
.inv-cs2-tip__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  padding: 5px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.inv-cs2-tip__row:first-child {
  border-top: 0;
  padding-top: 0;
}
.inv-cs2-tip__row span {
  color: #9aa0a6;
}
.inv-cs2-tip__row strong {
  color: #fff;
  font-weight: 700;
  text-align: right;
}
.inv-cs2-tip__hint {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: #6f7882;
}
.inv-cs2-ctx {
  pointer-events: auto;
  min-width: 200px;
  background: #1b1f24;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 2px;
  padding: 4px 0;
  box-shadow: 0 10px 28px rgba(0,0,0,0.5);
  max-height: min(80vh, 420px);
  overflow-y: auto;
}
.inv-cs2-ctx__item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #e8e8ea;
  text-align: left;
  padding: 8px 14px;
  font-size: 0.88rem;
  cursor: pointer;
}
.inv-cs2-ctx__item:hover:not(:disabled) {
  background: #2a6cb8;
}
.inv-cs2-ctx__item:disabled,
.inv-cs2-ctx__item--muted {
  color: #6a737c;
  cursor: default;
}
.inv-cs2-ctx__item--danger {
  color: #ff6b6b;
}
.inv-cs2-ctx__item--danger:hover:not(:disabled) {
  background: #5a2020;
  color: #ffb4b4;
}
.inv-cs2-ctx__sep {
  height: 1px;
  margin: 4px 0;
  background: rgba(255,255,255,0.1);
}

/* Inventory inspect — same shell as case unlock reveal (cases.css) */
.inv-cs2-inspect.case-unlock {
  z-index: 51000;
}
.inv-cs2-inspect .case-unlock__panel {
  width: min(1760px, calc(100vw - 12px));
  max-width: calc(100vw - 12px);
  height: min(95vh, 940px);
  max-height: min(95vh, 940px);
}
.inv-cs2-inspect .case-unlock__reveal-stage {
  background: transparent;
  padding: 0;
}
.inv-cs2-inspect .case-unlock__reveal-stage::before {
  z-index: 3;
}
.inv-cs2-inspect .case-unlock__reveal-stage > img {
  position: relative;
  z-index: 1;
  max-width: min(100%, 980px);
  max-height: min(62vh, 640px);
}
.inv-cs2-inspect__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  filter: saturate(1.35) brightness(0.92);
  background: #1a222c;
}
.case-unlock__reveal-stage .inv-cs2-inspect__3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.case-unlock__reveal-stage .inv-cs2-inspect__3d iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
  color-scheme: normal;
}
.case-unlock__reveal-stage .inv-cs2-inspect__3d-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #d7dde5;
  font-size: 0.95rem;
  background: rgba(20, 24, 30, 0.35);
  z-index: 2;
  pointer-events: none;
}
.case-unlock__reveal-stage .inv-cs2-inspect__3d[hidden],
.case-unlock__reveal-stage .inv-cs2-inspect__3d-loading[hidden] {
  display: none !important;
}
.kronos-bg-select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.35);
  color: #e8e8ea;
  font-size: 0.82rem;
}

/* Delete confirm floating modal */
.inv-cs2-confirm {
  position: fixed;
  inset: 0;
  z-index: 52000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 12, 0.65);
  backdrop-filter: blur(6px);
}
.inv-cs2-confirm[hidden] {
  display: none !important;
}
.inv-cs2-confirm__panel {
  width: min(380px, 94vw);
  background: #1b1e21;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  padding: 18px 18px 14px;
  color: #e8e8ea;
}
.inv-cs2-confirm__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.inv-cs2-confirm__text {
  margin: 0 0 16px;
  color: #b0b6bc;
  font-size: 0.9rem;
  line-height: 1.4;
}
.inv-cs2-confirm__text strong {
  color: #fff;
}
.inv-cs2-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.inv-cs2-confirm__actions .economy-btn.danger {
  background: #8b1e1e;
}
.inv-cs2-confirm__actions .economy-btn.danger:hover {
  background: #a52828;
}

@media (max-width: 1100px) {
  .inv-cs2-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}
@media (max-width: 900px) {
  .inv-cs2-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  }
  .inv-cs2-card {
    min-height: 190px;
  }
  .inv-cs2-card__media {
    min-height: 118px;
  }
  .inv-cs2-card__media img {
    max-height: 100px;
  }
}
@media (max-width: 640px) {
  .inv-cs2-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 7px;
  }
  .inv-cs2-card {
    min-height: 160px;
  }
}
