.sold-page {
  box-sizing: border-box;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 24px 72px;
}
.sold-page * { box-sizing: border-box; }

.sold-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
  padding: 10px 2px;
}

.sold-eyebrow { color: var(--accent-emerald); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.sold-hero h1 { margin: 6px 0 5px; font-size: clamp(36px, 4vw, 52px); line-height: 1; letter-spacing: -2px; }
.sold-hero p { margin: 0; color: var(--text-muted); font-size: 15px; }
.sold-search { display: grid; grid-template-columns: minmax(300px, 1fr) auto; gap: 10px; width: min(720px, 100%); }
.sold-search input, .sold-select { min-height: 50px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-input); color: var(--text-main); padding: 0 16px; font-size: 14px; outline: none; }
.sold-search input:focus, .sold-select:focus { border-color: var(--accent-emerald); box-shadow: 0 0 0 3px rgba(16,185,129,.1); }
.sold-btn { min-height: 50px; border: 0; border-radius: 14px; background: var(--accent-emerald); color: #03120d; font-weight: 900; padding: 0 24px; cursor: pointer; }
.sold-btn:disabled { opacity: .5; cursor: wait; }

.sold-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(220px, .55fr) auto; gap: 12px; margin-bottom: 16px; }
.sold-dataset-picker { position: relative; min-width: 0; }
.sold-dataset-picker .sold-select { width: 100%; padding-left: 44px; }
#soldDatasetSearch { text-transform: uppercase; }
.sold-dataset-icon { position: absolute; left: 16px; top: 25px; z-index: 2; transform: translateY(-50%); pointer-events: none; font-size: 15px; }
.sold-dataset-dropdown { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; max-height: 290px; padding: 6px; overflow-y: auto; scrollbar-width: none; border: 1px solid var(--border-color); border-radius: 14px; background: #131a24; box-shadow: 0 18px 35px rgba(0,0,0,.38); }
.sold-dataset-dropdown.show { display: block; }
.sold-dataset-dropdown::-webkit-scrollbar { display: none; }
.sold-dataset-option { width: 100%; min-height: 52px; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 7px 11px; border: 0; border-radius: 10px; background: transparent; color: var(--text-main); text-align: left; font-size: 14px; font-weight: 750; cursor: pointer; }
.sold-dataset-option:hover, .sold-dataset-option.active { background: #202c40; }
.sold-dataset-option small { color: #93c5fd; font-size: 10px; font-weight: 800; }
.sold-dataset-option.missing small { color: var(--accent-emerald); }
.sold-dataset-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--avatar-start, var(--accent-emerald)), var(--avatar-end, #0284c7)); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); font-size: 11px; font-weight: 900; }
.sold-dataset-empty { padding: 18px; color: var(--text-muted); text-align: center; font-size: 12px; }
.sold-dataset-create { width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; margin-top: 5px; padding: 10px 13px; border: 1px solid rgba(16,185,129,.32); border-radius: 11px; background: rgba(16,185,129,.08); color: var(--text-main); text-align: left; cursor: pointer; }
.sold-dataset-create:hover { background: rgba(16,185,129,.15); }
.sold-dataset-create > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-emerald); color: #03120d; font-size: 20px; font-weight: 900; }
.sold-dataset-create div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.sold-dataset-create strong { color: var(--accent-emerald); font-size: 13px; }
.sold-dataset-create small { overflow: hidden; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sold-dataset-picker input.sold-loading { opacity: .58; cursor: wait; }
.sold-period { display: grid; grid-template-columns: repeat(4, minmax(76px, 1fr)); gap: 5px; padding: 5px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-card); }
.sold-period button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.sold-period button:hover { color: var(--text-main); background: rgba(148,163,184,.08); }
.sold-period button.active { color: #04150f; background: var(--accent-emerald); box-shadow: 0 6px 16px rgba(16,185,129,.18); }

.sold-status { display: none; padding: 12px 15px; border-radius: 14px; font-size: 13px; margin-bottom: 16px; }
.sold-status.show { display: block; }
.sold-status.error { background: rgba(239,68,68,.12); color: #fca5a5; }
.sold-status.ok { background: rgba(16,185,129,.12); color: #6ee7b7; }

.sold-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.sold-card { min-width: 0; overflow: hidden; background: linear-gradient(150deg, rgba(22,38,61,.92), rgba(10,22,39,.94)); border: 1px solid rgba(101,133,171,.2); border-radius: 22px; padding: 22px; box-shadow: 0 18px 48px rgba(2,8,23,.22); }
.sold-kpi { min-height: 112px; display: flex; flex-direction: column; justify-content: center; }
.sold-kpi span { display: block; color: var(--text-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.sold-kpi strong { display: block; margin-top: 9px; font-size: 30px; line-height: 1; }
.sold-kpi.accent strong { color: var(--accent-emerald); }

.sold-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, .8fr); gap: 14px; margin-bottom: 14px; }
.sold-grid > .sold-card { min-width: 0; }
.sold-results-grid { grid-template-columns: minmax(0, 2.35fr) minmax(300px, .65fr); }
.sold-results-card { margin-bottom: 14px; }
.sold-insights-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(320px, .72fr); gap: 14px; margin-bottom: 14px; }
.sold-ranking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.sold-card h2 { margin: 0 0 18px; font-size: 15px; letter-spacing: -.15px; }
.sold-chart { height: 290px; }
.sold-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sold-card-heading h2 { margin: 0; }
.sold-card-heading > div:first-child { display: flex; flex-direction: column; }
.sold-card-heading strong { margin-top: 8px; font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.sold-card-heading small, .sold-card-heading > span { margin-top: 6px; color: var(--text-muted); font-size: 11px; font-weight: 700; }
.sold-chart-modes { display: flex; flex: 0 0 auto; gap: 3px; padding: 4px; border: 1px solid var(--border-color); border-radius: 999px; background: rgba(2,6,23,.38); }
.sold-chart-modes button { border: 0; border-radius: 999px; padding: 7px 11px; background: transparent; color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.sold-chart-modes button.active { background: rgba(59,130,246,.18); color: #93c5fd; }
.sold-volume-card .sold-chart { height: 330px; }
.sold-top-sellers-card .sold-seller-list { max-height: 390px; overflow-y: auto; scrollbar-width: none; }
.sold-top-sellers-card .sold-seller-list::-webkit-scrollbar { display: none; }
.sold-market-list, .sold-brand-list, .sold-seller-list { display: flex; flex-direction: column; gap: 13px; }
.sold-bar-row { display: grid; grid-template-columns: 125px 1fr 48px; gap: 11px; align-items: center; font-size: 12px; }
.sold-bar-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sold-bar { height: 8px; border-radius: 20px; background: #0b1220; overflow: hidden; }
.sold-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-emerald), #38bdf8); }

.sold-results-card { padding: 18px; }
.sold-table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow: auto; max-height: 760px; padding: 0 2px; scrollbar-width: none; }
.sold-table-wrap::-webkit-scrollbar { display: none; }
.sold-table { width: 100%; min-width: 960px; border-collapse: separate; border-spacing: 0 7px; }
.sold-table th { position: sticky; top: 0; z-index: 2; padding: 11px 14px; background: #101b2b; color: #8497ae; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
.sold-table th:first-child { border-radius: 12px 0 0 12px; }
.sold-table th:last-child { border-radius: 0 12px 12px 0; }
.sold-table td { padding: 11px 14px; border: 0; background: rgba(24,39,61,.72); font-size: 13px; vertical-align: middle; }
.sold-table td:first-child { border-radius: 14px 0 0 14px; }
.sold-table td:last-child { border-radius: 0 14px 14px 0; }
.sold-table tbody tr { content-visibility: auto; contain-intrinsic-size: 78px; transition: transform .18s ease, filter .18s ease; }
.sold-table tbody tr:hover { transform: translateY(-1px); filter: brightness(1.08); }
.sold-product { display: flex; align-items: center; gap: 14px; min-width: 390px; }
.sold-product img, .sold-image-placeholder { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 13px; object-fit: cover; background: #0b1220; }
.sold-product a { color: var(--text-main); text-decoration: none; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sold-product a:hover { color: var(--accent-emerald); }
.sold-price { color: var(--accent-emerald); font-weight: 900; white-space: nowrap; }
.sold-table-seller { display: flex; min-width: 150px; flex-direction: column; gap: 3px; }
.sold-table-seller strong { color: var(--text-main); font-size: 12px; }
.sold-table-seller small { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.sold-seller-row { display: grid; grid-template-columns: 24px 38px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 7px 9px; border-radius: 12px; background: rgba(15,23,42,.45); }
.sold-seller-row > b { color: var(--text-muted); font-size: 12px; text-align: center; }
.sold-seller-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--avatar-start, #2563eb), var(--avatar-end, var(--accent-emerald))); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); color: #fff; font-size: 11px; font-weight: 900; }
.sold-seller-row div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sold-seller-row strong { overflow: hidden; color: var(--text-main); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sold-seller-row small { color: var(--text-muted); font-size: 10px; }
.sold-seller-row em { color: var(--accent-emerald); font-size: 12px; font-style: normal; font-weight: 900; }
.sold-pill { display: inline-flex; padding: 5px 9px; border-radius: 20px; background: rgba(59,130,246,.12); color: #93c5fd; font-weight: 800; white-space: nowrap; }
.sold-empty { padding: 54px !important; color: var(--text-muted); text-align: center; }
.sold-load-sentinel { display: none; width: 100%; height: 2px; }
.sold-load-sentinel.show { display: block; }
.sold-spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(3,18,13,.3); border-top-color: #03120d; border-radius: 50%; animation: sold-spin .7s linear infinite; }
@keyframes sold-spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .sold-hero { align-items: stretch; flex-direction: column; }
  .sold-search { width: 100%; }
  .sold-toolbar { grid-template-columns: 1fr 1fr; }
  .sold-period { grid-column: 1 / -1; }
  .sold-grid, .sold-results-grid, .sold-insights-grid { grid-template-columns: 1fr; }
  .sold-ranking-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sold-results-card { padding: 16px; overflow: visible; }
  .sold-table-wrap {
    max-height: 70dvh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 3px 18px 0;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }
  .sold-table, .sold-table tbody, .sold-table tr, .sold-table td { display: block; width: 100%; min-width: 0; }
  .sold-table { border-spacing: 0; }
  .sold-table thead { display: none; }
  .sold-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .sold-table tbody tr { padding: 14px; border: 1px solid rgba(101,133,171,.18); border-radius: 18px; background: rgba(16,30,49,.84); }
  .sold-table tbody tr:hover { transform: none; }
  .sold-table td, .sold-table td:first-child, .sold-table td:last-child { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 38px; padding: 8px 2px; border-radius: 0; border-bottom: 1px solid rgba(148,163,184,.08); background: transparent; text-align: right; }
  .sold-table td::before { content: attr(data-label); flex: 0 0 auto; color: #71869f; font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
  .sold-table td:first-child { display: block; padding: 0 0 12px; }
  .sold-table td:first-child::before { display: none; }
  .sold-table td:last-child { border-bottom: 0; }
  .sold-product { min-width: 0; text-align: left; }
  .sold-product img, .sold-image-placeholder { width: 72px; height: 72px; flex-basis: 72px; }
  .sold-table-seller { min-width: 0; align-items: flex-end; }
}

@media (max-width: 720px) {
  .sold-page { padding: 18px 14px 56px; }
  .sold-hero { gap: 18px; margin-bottom: 14px; }
  .sold-hero h1 { font-size: 38px; letter-spacing: -1.4px; }
  .sold-search { grid-template-columns: 1fr; }
  .sold-toolbar { grid-template-columns: 1fr; }
  .sold-dataset-dropdown { max-height: 182px; }
  .sold-period { grid-column: auto; grid-template-columns: repeat(4, 1fr); overflow-x: auto; scrollbar-width: none; }
  .sold-period button { min-width: 68px; padding: 0 8px; }
  .sold-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sold-card { padding: 16px; border-radius: 17px; }
  .sold-kpi { min-height: 94px; }
  .sold-kpi strong { font-size: 24px; }
  .sold-chart { height: 230px; }
  .sold-card-heading { flex-direction: column; }
  .sold-chart-modes { width: 100%; }
  .sold-chart-modes button { flex: 1; }
  .sold-volume-card .sold-chart { height: 250px; }
  .sold-product { min-width: 260px; }
  .sold-product img, .sold-image-placeholder { flex-basis: 58px; width: 58px; height: 58px; }
  .sold-table tbody { grid-template-columns: 1fr; }
}
.sold-upgrade-modal{position:fixed;inset:0;z-index:4000;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(2,8,18,.78);backdrop-filter:blur(12px)}
.sold-upgrade-modal.show{display:flex}
.sold-upgrade-dialog{width:min(100%,430px);padding:34px;text-align:center;border:1px solid rgba(16,217,150,.28);border-radius:26px;background:linear-gradient(150deg,#14253b,#091522);box-shadow:0 30px 80px rgba(0,0,0,.55)}
.sold-upgrade-icon{display:grid;place-items:center;width:58px;height:58px;margin:0 auto 18px;border-radius:18px;color:#04120e;background:#10d996;font-size:28px;font-weight:900;box-shadow:0 14px 32px rgba(16,217,150,.24)}
.sold-upgrade-dialog h2{margin:0 0 10px;color:#fff;font-size:27px}
.sold-upgrade-dialog p{margin:0 auto 24px;color:#aabbd0;line-height:1.6}
.sold-upgrade-primary,.sold-upgrade-secondary{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;border:0;border-radius:14px;font-weight:800;text-decoration:none;cursor:pointer}
.sold-upgrade-primary{color:#03120e;background:#10d996;box-shadow:0 12px 28px rgba(16,217,150,.2)}
.sold-upgrade-secondary{margin-top:10px;color:#9fb0c5;background:transparent}

@media (max-width: 720px) {
  html, body { min-height: 100%; height: auto !important; overflow-x: hidden !important; overflow-y: auto !important; touch-action: pan-y !important; }
  .sold-page { display: block; min-height: 100dvh; overflow: visible !important; padding-bottom: 90px; }
  .sold-results-card { max-height: none !important; overflow: visible !important; }
  .sold-table-wrap {
    max-height: 72dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
  }
  .sold-table, .sold-table tbody { max-height: none !important; overflow: visible !important; }
  .sold-toolbar { position: relative; z-index: 4; }
}
