/* ── Dashboard-specific styles (extends style.css) ─────────────────────── */

/* Override body for dashboard layout */
.dashboard-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SIGN-IN WALL ──────────────────────────────────────────────────────────── */
.signin-wall {
  position: fixed;
  inset: 0;
  background: var(--navy);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.signin-card {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 32px 64px rgba(0,0,0,0.5), 0 0 80px rgba(212,160,23,0.05);
}

.signin-logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text1);
  text-align: center;
  margin-bottom: 16px;
}
.signin-logo span { color: var(--gold); }

/* Override Clerk's injected styles to match our dark theme */
#clerkSignIn {
  --clerk-primary-color: #d4a017;
  margin-top: 8px;
}
/* Clerk renders an iframe — we just give it space */
#clerkSignIn .cl-rootBox { width: 100%; }

/* ── NAV user menu ─────────────────────────────────────────────────────────── */
.btn-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px 6px 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--text1);
  transition: border-color 0.15s;
}
.btn-user-menu:hover { border-color: var(--gold-border); }

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1200;
  overflow: hidden;
}

.nav-right {
  position: relative;
}

.user-dropdown-email {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.user-dropdown-item:hover {
  background: var(--navy3);
  color: var(--danger);
}


/* ── NAV overrides for dashboard ──────────────────────────────────────────── */
nav {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 72px !important;
  min-height: 72px !important;
  max-height: 72px !important;
  padding: 0 32px !important;
  box-sizing: border-box;
  overflow: visible;
  z-index: 1100 !important;
}

.nav-logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-center {
  text-align: center;
}

.nav-page-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.5px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.btn-import {
  background: transparent;
  border: 1px solid var(--gold-border);
  color: var(--gold);
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  letter-spacing: 0.3px;
}
.btn-import:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
}

/* ── LAYOUT ────────────────────────────────────────────────────────────────── */
.dash-layout {
  flex: 1;
  min-height: calc(100vh - 72px);
  margin-top: 72px;
}

/* ── MAIN CONTENT ──────────────────────────────────────────────────────────── */
.dash-main {
  flex: 1;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ── STATS BAR ─────────────────────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.stat-tile {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}
.stat-tile:hover { border-color: var(--gold-border); }

.stat-tile-gold {
  border-color: var(--gold-border);
  background: linear-gradient(135deg, var(--navy2), #1a1f0a);
  box-shadow: 0 0 24px rgba(212,160,23,0.06);
}

.stat-tile-num {
  font-size: 24px;
  font-weight: 900;
  color: var(--text1);
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.stat-tile-gold .stat-tile-num { color: var(--gold); }

.stat-tile-label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ── Value tile meta row (delta + last-updated) ── */
.stat-tile-value-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 16px;
}

.value-delta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-radius: 4px;
  padding: 1px 5px;
}
.value-delta.up   { color: #3fb950; background: rgba(63,185,80,0.12); }
.value-delta.down { color: #f85149; background: rgba(248,81,73,0.12); }
.value-delta.flat { color: var(--text3); background: transparent; }

.value-updated-at {
  font-size: 10px;
  color: var(--text3);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-refresh-prices {
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.3px;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}
.btn-refresh-prices:hover:not(:disabled) {
  background: rgba(212,160,23,0.12);
}
.btn-refresh-prices:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── TOOLBAR ───────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-left {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
  line-height: 1;
}

.search-input {
  width: 100%;
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text1);
  font-size: 13px;
  padding: 9px 36px 9px 36px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--text3); }
.search-input:focus { border-color: var(--gold-border); }

.search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.search-clear:hover { color: var(--text1); }

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text3);
  text-transform: uppercase;
}

.filter-select {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text1);
  font-size: 12px;
  padding: 7px 28px 7px 10px;
  outline: none;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b949e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.filter-select:focus { border-color: var(--gold-border); }
.filter-select option { background: var(--navy2); }

.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
}

.view-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 15px;
  padding: 5px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}
.view-btn:hover { color: var(--text1); }
.view-btn.active {
  background: var(--navy4);
  color: var(--text1);
}

/* ── ACTIVE FILTERS ────────────────────────────────────────────────────────── */
.active-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}

.filter-chip-remove {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.12s;
}
.filter-chip-remove:hover { opacity: 1; }

/* ── RESULTS HEADER ────────────────────────────────────────────────────────── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: -8px;
}

.results-count {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}

.clear-filters-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
}
.clear-filters-btn:hover { color: var(--gold-bright); }

/* ── CARDS GRID ────────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.cards-grid.list-view {
  grid-template-columns: 1fr;
  gap: 8px;
}

/* ── CARD TILE (Grid view) ─────────────────────────────────────────────────── */
.card-tile {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.card-tile:hover {
  border-color: var(--gold-border);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 20px rgba(212,160,23,0.06);
}

.card-tile-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--navy3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.card-tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-tile-thumb-placeholder {
  font-size: 48px;
  opacity: 0.3;
}

.card-tile-sport-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(13,17,23,0.85);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text2);
  padding: 2px 6px;
  backdrop-filter: blur(4px);
}

.card-tile-rc-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--gold);
  border-radius: 3px;
  font-size: 8px;
  font-weight: 900;
  color: #000;
  padding: 2px 5px;
  letter-spacing: 0.5px;
}

.card-tile-body {
  padding: 12px 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-tile-player {
  font-size: 13px;
  font-weight: 700;
  color: var(--text1);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-tile-meta {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.4;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 6px;
}

.card-tile-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.3px;
}
.card-tile-price.no-price {
  color: var(--text3);
  font-size: 12px;
  font-weight: 500;
}

.card-tile-cond {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.cond-nm    { background: rgba(63,185,80,0.12);  color: #3fb950; }
.cond-good  { background: rgba(210,153,34,0.12); color: #d29922; }
.cond-fair  { background: rgba(248,81,73,0.12);  color: #f85149; }
.cond-grade { background: rgba(212,160,23,0.12); color: var(--gold); }

/* ── CARD ROW (List view) ──────────────────────────────────────────────────── */
.card-row {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.card-row:hover {
  border-color: var(--gold-border);
  background: #1a1f2a;
}

.card-row-thumb {
  width: 44px;
  height: 62px;
  border-radius: 6px;
  background: var(--navy3);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  opacity: 0.4;
}
.card-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

.card-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-row-title {
  flex: 1;
  min-width: 0;
}

.card-row-player {
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-row-meta {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.card-row-chips {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.chip-sm {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.card-row-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
  min-width: 72px;
  text-align: right;
}
.card-row-price.no-price {
  color: var(--text3);
  font-size: 12px;
  font-weight: 400;
}

.card-row-date {
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
  min-width: 68px;
  text-align: right;
}

.card-row-chevron {
  color: var(--text3);
  font-size: 20px;
  flex-shrink: 0;
}

/* ── EMPTY / NO-RESULTS STATES ─────────────────────────────────────────────── */
.empty-state,
.no-results-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 24px;
  text-align: center;
}

.empty-icon { font-size: 64px; opacity: 0.6; }
.empty-state h2,
.no-results-state h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text1);
}
.empty-state p,
.no-results-state p {
  font-size: 15px;
  color: var(--text2);
  max-width: 380px;
  line-height: 1.6;
}

/* ── MODAL ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: slideUp 0.2s ease;
  scroll-padding-bottom: 24px;
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--navy3);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: color 0.12s, background 0.12s;
  z-index: 1;
}
.modal-close:hover { color: var(--text1); background: var(--navy4); }

/* ── MODAL BODY (card detail) ──────────────────────────────────────────────── */
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.modal-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-card-img {
  width: 100px;
  height: 140px;
  border-radius: 8px;
  background: var(--navy3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}
.modal-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-hero-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text1);
  line-height: 1.3;
}

.modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.modal-chip {
  background: var(--navy3);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}
.modal-chip-gold {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-weight: 700;
}

.modal-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
}

.modal-price {
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -0.5px;
}

.modal-price-label {
  font-size: 12px;
  color: var(--text3);
}

.modal-conf {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-conf-bar-bg {
  flex: 1;
  height: 4px;
  background: var(--navy4);
  border-radius: 2px;
  overflow: hidden;
}
.modal-conf-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.modal-conf-label {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.modal-section {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-section:last-child { border-bottom: none; }

.modal-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.modal-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.modal-kv {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(48,54,61,0.5);
  gap: 12px;
}
.modal-kv:nth-child(even) { padding-left: 16px; }
.modal-kv:nth-last-child(-n+2) { border-bottom: none; }

.modal-kv-key {
  font-size: 12px;
  color: var(--text2);
  flex: 1;
}
.modal-kv-val {
  font-size: 12px;
  color: var(--text1);
  font-weight: 500;
  text-align: right;
}

.modal-pricing-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pricing-stat-box {
  background: var(--navy3);
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border);
}
.pricing-stat-label {
  font-size: 10px;
  color: var(--text3);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.pricing-stat-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text1);
}
.pricing-stat-val.accent { color: var(--gold); }

.modal-date {
  font-size: 12px;
  color: var(--text3);
}

/* ── IMPORT MODAL ──────────────────────────────────────────────────────────── */
.modal-import {
  max-width: 480px;
}

.modal-import-body {
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.import-icon {
  font-size: 48px;
}

.modal-import-body h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text1);
}

.import-desc {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.6;
  max-width: 360px;
}

.import-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  text-align: left;
}

.import-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
}

.import-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.import-drop-zone {
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.import-drop-zone:hover,
.import-drop-zone.drag-over {
  border-color: var(--gold-border);
  background: var(--gold-dim);
}

.drop-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.drop-icon { font-size: 32px; }

.drop-zone-inner p {
  color: var(--text2);
  font-size: 13px;
  margin: 0;
}

.import-divider {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  color: var(--text3);
  font-size: 12px;
}
.import-divider::before,
.import-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-ghost-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
  letter-spacing: 0.3px;
}
.btn-ghost-outline:hover {
  border-color: var(--gold-border);
  color: var(--gold);
}

.btn-ghost-outline:hover {
  border-color: var(--gold-border);
  color: var(--gold);
}

/* ── eBay SOLD COMPS ───────────────────────────────────────────────────────── */
.modal-section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-section-header-row .modal-section-title {
  margin: 0;
}

.btn-fetch-comps {
  background: transparent;
  border: 1px solid var(--gold-border);
  color: var(--gold);
  border-radius: 6px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-fetch-comps:hover:not(:disabled) { background: var(--gold-dim); }
.btn-fetch-comps:disabled { opacity: 0.55; cursor: default; }

.comps-placeholder {
  font-size: 13px;
  color: var(--text3);
  margin: 0;
  line-height: 1.5;
}

.comps-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text3);
}

.comps-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.comps-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: var(--navy);
  text-decoration: none;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}
.comp-row:last-child { border-bottom: none; }
.comp-row:hover { background: var(--navy3); }

.comp-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.comp-row:hover .comp-title { color: var(--text1); }

.comp-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.comp-date {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}

.comp-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}

.comps-view-all {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  margin-top: 8px;
  transition: color 0.15s;
}
.comps-view-all:hover { color: var(--gold-bright, #f0c040); text-decoration: underline; }

/* ── Data quality indicators ─────────────────────────────────────────────────*/
.data-quality-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.2px;
}
.data-quality-high       { background: rgba(48,209,88,0.15);  color: #30d158; }
.data-quality-medium     { background: rgba(255,159,10,0.15); color: #ff9f0a; }
.data-quality-low        { background: rgba(255,69,58,0.18);  color: #ff453a; }
.data-quality-insufficient { background: rgba(255,69,58,0.18); color: #ff453a; }

.pricing-quality-note {
  font-size: 11px;
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: 6px;
}
.pricing-quality-high   { color: var(--text3); background: none; padding: 0; margin-top: 8px; }
.pricing-quality-medium { background: rgba(255,159,10,0.08); color: #ff9f0a; border: 1px solid rgba(255,159,10,0.2); }
.pricing-quality-low    { background: rgba(255,69,58,0.08);  color: #ff453a; border: 1px solid rgba(255,69,58,0.2); }

.pricing-query-used {
  font-size: 10px;
  color: var(--text3);
  margin: 6px 0 0;
  font-style: italic;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pricing-insufficient {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255,69,58,0.07);
  border: 1px solid rgba(255,69,58,0.2);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 4px;
}
.pricing-insufficient-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.pricing-insufficient-title {
  font-size: 13px;
  font-weight: 700;
  color: #ff453a;
  margin-bottom: 4px;
}
.pricing-insufficient-body {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}

/* ── TOAST ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.25s ease;
  white-space: nowrap;
}
.toast.toast-success { border-color: rgba(63,185,80,0.4); color: var(--green); }
.toast.toast-error   { border-color: rgba(248,81,73,0.4);  color: var(--danger); }

@keyframes toastIn {
  from { transform: translateX(-50%) translateY(12px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

/* ── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat-tile:nth-child(4),
  .stat-tile:nth-child(5) {
    grid-column: span 1;
  }
}

@media (max-width: 900px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  nav {
    grid-template-columns: auto 1fr;
    gap: 0;
    padding: 0 20px !important;
  }
  .nav-center { display: none; }

  .dash-main { padding: 16px; gap: 14px; }

  .stats-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat-tile { padding: 12px 14px; }
  .stat-tile-num { font-size: 20px; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left { max-width: none; }
  .toolbar-right { flex-wrap: wrap; gap: 8px; }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .modal { border-radius: var(--radius); }
  .modal-hero { grid-template-columns: 1fr; }
  .modal-card-img { width: 80px; height: 112px; }
  .modal-kv-grid { grid-template-columns: 1fr; }
  .modal-kv:nth-child(even) { padding-left: 0; }
  .modal-kv:nth-last-child(-n+2) { border-bottom: 1px solid rgba(48,54,61,0.5); }
  .modal-kv:last-child { border-bottom: none; }
  .modal-pricing-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── eBay list button ──────────────────────────────────────────────────────── */
.btn-ebay-list {
  display: inline-block;
  background: #e53238;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}
.btn-ebay-list:hover { background: #c42a2f; }

/* ── Re-analyze with hints ─────────────────────────────────────────────────── */
.modal-reanalyze-section {
  scroll-margin-bottom: 24px;
}

.reanalyze-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--navy2, #1a1f2e);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text1, #e8e8e8);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  min-height: 72px;
  outline: none;
  transition: border-color 0.15s;
  scroll-margin-bottom: 24px;
}
.reanalyze-textarea:focus { border-color: var(--gold-border); }
.reanalyze-textarea::placeholder { color: var(--text3); }

.reanalyze-status {
  font-size: 12px;
  color: var(--text3);
}

/* ── Remove card danger zone ───────────────────────────────────────────────── */
.modal-danger-zone {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.btn-remove-card {
  background: transparent;
  border: 1px solid rgba(220, 60, 60, 0.4);
  color: var(--danger, #e05555);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-remove-card:hover {
  background: rgba(220, 60, 60, 0.1);
  border-color: rgba(220, 60, 60, 0.7);
}

/* ── Scan Cards button ─────────────────────────────────────────────────────── */
.btn-scan {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  letter-spacing: 0.3px;
}
.btn-scan:hover {
  background: rgba(212,160,23,0.2);
  border-color: var(--gold);
}

/* ── Results header right side ─────────────────────────────────────────────── */
.results-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-select-all {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
}
.btn-select-all:hover { color: var(--gold-bright, #f0c030); }

/* ── Bulk action bar ───────────────────────────────────────────────────────── */
.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy2);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 10px 16px;
  animation: slideDown 0.15s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bulk-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.bulk-actions {
  display: flex;
  gap: 8px;
}

.btn-bulk-list {
  background: #e53238;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.3px;
}
.btn-bulk-list:hover { background: #c42a2f; }
.btn-bulk-list:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-bulk-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-bulk-cancel:hover { border-color: var(--text2); color: var(--text1); }

/* ── Card selection overlay ────────────────────────────────────────────────── */
.card-tile.selectable,
.card-row.selectable {
  user-select: none;
}

.card-tile.selected {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(212,160,23,0.3), 0 8px 24px rgba(0,0,0,0.3);
}
.card-row.selected {
  border-color: var(--gold) !important;
  background: rgba(212,160,23,0.06) !important;
}

.card-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(13,17,23,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  backdrop-filter: blur(4px);
  transition: border-color 0.12s, background 0.12s;
  z-index: 2;
  pointer-events: none;
}
.card-tile.selected .card-select-checkbox {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

.card-row-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--border);
  background: var(--navy3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  transition: border-color 0.12s, background 0.12s;
}
.card-row.selected .card-row-checkbox {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

/* ── Scan modal ────────────────────────────────────────────────────────────── */
.modal-scan,
.modal-bulk-list {
  max-width: 560px;
}

.modal-scan-body,
.modal-bulk-list-body {
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scan-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.scan-drop-zone:hover,
.scan-drop-zone.drag-over {
  border-color: var(--gold-border);
  background: var(--gold-dim);
}
.scan-drop-zone .drop-zone-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scan-drop-zone p { font-size: 14px; color: var(--text2); margin: 0; }

.scan-tip {
  font-size: 12px;
  color: var(--text3);
  margin: 0;
}

.scan-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
  margin-bottom: 6px;
}

.scan-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--navy3);
  border-radius: 3px;
  overflow: hidden;
}

.scan-progress-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.scan-progress-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.scan-progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy3);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
}

.scan-progress-thumb {
  width: 32px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--navy2);
}

.scan-progress-name {
  flex: 1;
  min-width: 0;
  color: var(--text2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.scan-progress-status {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
}
.scan-status-pending  { color: var(--text3); }
.scan-status-running  { color: var(--gold); }
.scan-status-done     { color: #3fb950; }
.scan-status-error    { color: var(--danger, #f85149); }

/* ── Scan staging (front + back pairing) ───────────────────────────────────── */
#scanStagingWrap {
  width: 100%;
}

.scan-staging-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.scan-staging-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text1);
}

.btn-scan-add {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-scan-add:hover { border-color: var(--gold-border); color: var(--gold); }

.scan-slot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 2px;
}

.scan-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy3);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.scan-slot-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.scan-slot-images {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.scan-slot-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}

.scan-slot-thumb {
  width: 38px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.scan-slot-img-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.scan-slot-back-wrap {
  min-width: 52px;
}

.btn-scan-add-back {
  width: 38px;
  height: 52px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: var(--navy2);
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1.2;
  text-align: center;
}
.btn-scan-add-back:hover { border-color: var(--gold-border); color: var(--gold); }

.scan-slot-remove-back {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: var(--danger, #f85149);
  color: #fff;
  font-size: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.scan-slot-remove {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.scan-slot-remove:hover { color: var(--danger, #f85149); }

.scan-staging-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.scan-staging-clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.scan-staging-clear:hover { border-color: var(--danger, #f85149); color: var(--danger, #f85149); }
