:root {
  color-scheme: dark;
  --paper: #0d1218;
  --paper-deep: #111923;
  --card: #171f29;
  --ink: #edf3f7;
  --muted: #94a2ae;
  --line: #2d3946;
  --green: #67cdb8;
  --green-soft: rgba(103, 205, 184, .13);
  --red: #f0808c;
  --red-soft: rgba(240, 128, 140, .14);
  --gold: #84a7ff;
  --positive: #67d8ac;
  --negative: #ff7f8b;
  --shadow: 0 16px 40px rgba(0, 0, 0, .26);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(240, 128, 140, .07), transparent 25%),
    radial-gradient(circle at 90% 24%, rgba(103, 205, 184, .07), transparent 28%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 4px),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  padding: 0;
  border-bottom: 1px solid rgba(142, 163, 181, .18);
  background: rgba(13, 18, 24, .9);
  backdrop-filter: blur(16px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; width: min(1480px, calc(100% - 40px)); min-height: inherit; margin-inline: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand > span:last-child { display: grid; gap: 0; }
.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.035em;
}
.brand strong span { color: var(--red); font-style: italic; font-weight: 500; }
.brand small { color: var(--muted); font-family: Georgia, serif; font-size: 11px; font-style: italic; }
.brand-mark {
  position: relative;
  width: 38px;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(var(--red) 0 48%, #dfe8ee 48% 100%);
}
.brand-mark::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--ink);
}
.brand-mark i {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #dfe8ee;
}

.header-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.header-meta strong { color: var(--ink); font-weight: 650; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }

main, footer { width: min(1480px, calc(100% - 40px)); margin-inline: auto; }
main { padding-top: 30px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metric {
  position: relative;
  min-height: 154px;
  padding: 23px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 31, 41, .88);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .13);
}
.metric::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -28px;
  width: 88px;
  height: 88px;
  border: 1px solid rgba(103, 205, 184, .09);
  border-radius: 50%;
}
.metric-primary { background: linear-gradient(145deg, rgba(103,205,184,.16), rgba(23,31,41,.92)); border-color: rgba(103,205,184,.32); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: #b8c4cd; font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.metric-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.035);
  color: var(--green);
  font-family: Georgia, serif;
}
.metric > strong { display: block; margin-top: 22px; font-family: Georgia, serif; font-size: clamp(28px, 3vw, 39px); line-height: 1; letter-spacing: -.035em; }
.metric > p { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.neutral { color: var(--muted) !important; }

.workspace { padding: 66px 0 40px; }
.workspace-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-kicker { margin: 0 0 6px; color: var(--red); font-family: Georgia, serif; font-size: 14px; font-style: italic; }
.workspace h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 62px); font-weight: 500; letter-spacing: -.045em; }
.view-toggle { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(23,31,41,.72); }
.view-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; }
.view-button.active { background: var(--green); color: #0b1b18; box-shadow: 0 4px 12px rgba(103,205,184,.16); }

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  margin-top: 28px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(23, 31, 41, .8);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
}
.status-tabs { display: flex; align-items: center; gap: 3px; }
.status-tab { min-height: 41px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-tab span { margin-left: 5px; color: #697887; }
.status-tab.active { background: var(--green-soft); color: var(--green); font-weight: 700; }
.status-tab.active span { color: var(--red); }
.search-control, .select-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 41px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(11, 16, 22, .52);
  color: var(--muted);
}
.search-control:focus-within, .select-control:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(103,205,184,.08); }
.search-control input, .select-control select { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-control input::placeholder { color: #6f7c88; }
.select-control > span { color: #7f8d99; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.select-control select { min-width: 120px; }
.sort-control select { min-width: 180px; }
.results-summary { min-height: 20px; margin: 16px 2px; color: var(--muted); font-family: Georgia, serif; font-size: 13px; font-style: italic; }

.card-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 15px; }
.collection-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(23, 31, 41, .9);
  box-shadow: 0 8px 20px rgba(0,0,0,.14);
  transition: transform .2s ease, box-shadow .2s ease;
}
.collection-card:nth-child(6n+2), .collection-card:nth-child(7n+5) { transform: rotate(.18deg); }
.collection-card:hover { transform: translateY(-4px) rotate(0); box-shadow: var(--shadow); }
.collection-card.sold { border-color: rgba(240,128,140,.45); }
.image-frame {
  position: relative;
  display: block;
  width: calc(100% - 22px);
  aspect-ratio: 5 / 7;
  margin: 11px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: inherit;
}
.image-frame img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: transform .28s ease; }
.image-zoom-trigger:not(:disabled) { cursor: zoom-in; }
.image-zoom-trigger:not(:disabled):hover img { transform: scale(1.018); }
.image-zoom-trigger:focus-visible { outline: 3px solid rgba(103,205,184,.28); outline-offset: 2px; }
.image-zoom-trigger:disabled { cursor: default; }
.card-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(135deg, rgba(103,205,184,.04) 0 1px, transparent 1px 8px), #131c25;
}
.card-placeholder::before { content: ""; width: 67%; aspect-ratio: .72; border: 1px solid rgba(103,205,184,.18); border-radius: 12px; }
.placeholder-copy { position: absolute; display: grid; place-items: center; gap: 8px; text-align: center; }
.placeholder-copy b { font-family: Georgia, serif; font-size: 30px; font-weight: 400; }
.placeholder-copy small { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.sold-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 31px;
  height: 29px;
  padding: 0 8px;
  border: 1px solid rgba(240,128,140,.25);
  border-radius: 9px;
  background: rgba(13,18,24,.88);
  box-shadow: 0 3px 9px rgba(0,0,0,.18);
}
.sold-badge { color: var(--red); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.card-content { padding: 5px 14px 14px; }
.card-title-row, .table-name-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.card-content h3 { overflow: hidden; margin: 0; font-family: Georgia, serif; font-size: 19px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.name-language-flag { display: inline-flex; flex: 0 0 auto; width: 22px; height: 15px; overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.name-language-flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-set { overflow: hidden; margin: 7px 0 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.card-set span { color: var(--red); }
.card-condition { margin: 5px 0 0; color: #7f8d99; font-size: 10px; }
.card-finance { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.card-price small, .card-return small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.card-price strong { font-family: Georgia, serif; font-size: 22px; letter-spacing: -.03em; }
.card-return { text-align: right; }
.card-return strong { font-size: 11px; }
.card-cost { margin: 8px 0 0; color: #7f8d99; font-size: 10px; }

.table-shell { overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: rgba(23,31,41,.88); box-shadow: var(--shadow); }
table { width: 100%; min-width: 1270px; border-collapse: collapse; }
thead { position: sticky; top: 0; z-index: 3; background: #1c2632; }
th { height: 49px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
th button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
th button:hover { color: var(--green); }
th button[data-table-sort]::after { content: "↕"; color: #667583; font-size: 13px; font-weight: 400; line-height: 1; }
th button[data-sort-direction="asc"]::after { content: "↑"; color: var(--red); }
th button[data-sort-direction="desc"]::after { content: "↓"; color: var(--red); }
th[aria-sort="ascending"] button, th[aria-sort="descending"] button { color: var(--ink); }
.column-heading { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.column-help { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid #526170; border-radius: 50%; color: #a9b6c1; font-size: 10px; font-weight: 800; line-height: 1; text-transform: none; cursor: help; }
.column-help::after { content: attr(data-tooltip); position: absolute; z-index: 20; top: calc(100% + 9px); right: 0; width: 235px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #202b37; color: #e7eef3; box-shadow: 0 10px 28px rgba(0,0,0,.34); font-size: 11px; font-weight: 500; letter-spacing: 0; line-height: 1.45; text-align: left; text-transform: none; white-space: normal; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s; pointer-events: none; }
.column-help:hover::after, .column-help:focus-visible::after { opacity: 1; visibility: visible; transform: translateY(0); }
.column-help:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
th.number, td.number { text-align: right; }
td { height: 73px; padding: 8px 14px; border-bottom: 1px solid #26323e; color: #cdd7de; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(103,205,184,.045); }
.table-thumb { display: block; width: 42px; height: 59px; padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: transparent; cursor: zoom-in; transition: transform .16s ease, box-shadow .16s ease; }
.table-thumb:hover, .table-thumb:focus-visible { z-index: 2; transform: scale(1.08); box-shadow: 0 5px 14px rgba(0,0,0,.28); outline: none; }
.table-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.table-thumb .card-placeholder::before { display: none; }
.table-thumb .placeholder-copy b { font-size: 13px; }
.table-thumb .placeholder-copy small { display: none; }
.table-name strong { display: block; max-width: 200px; overflow: hidden; color: var(--ink); font-family: Georgia, serif; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.table-name-row .name-language-flag { width: 19px; height: 13px; }
.table-name small, .table-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.order-link { display: inline-flex; align-items: center; gap: 4px; color: #aebdca; text-decoration: none; transition: color .15s ease; }
.order-link strong { color: var(--green); font-weight: 700; }
.order-link > span { opacity: .72; font-size: 11px; transition: transform .15s ease; }
.order-link:hover, .order-link:focus-visible { color: var(--ink); outline: none; }
.order-link:hover strong, .order-link:focus-visible strong { text-decoration: underline; text-underline-offset: 2px; }
.order-link:hover > span, .order-link:focus-visible > span { transform: translate(1px, -1px); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.status-pill.sold { background: var(--red-soft); color: var(--red); }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.image-lightbox {
  width: min(680px, calc(100% - 28px));
  max-width: none;
  max-height: 94vh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--card);
}
.image-lightbox::backdrop { background: rgba(5, 8, 12, .82); backdrop-filter: blur(7px); }
.lightbox-content { position: relative; display: grid; justify-items: center; gap: 10px; }
.lightbox-content img { display: block; max-width: 100%; max-height: 84vh; object-fit: contain; border-radius: 18px; box-shadow: 0 28px 80px rgba(0,0,0,.42); animation: cardZoomIn .2s ease-out; }
.lightbox-content p { margin: 0; padding: 7px 13px; border-radius: 999px; background: rgba(13,18,24,.82); color: var(--ink); font-family: Georgia, serif; font-size: 13px; text-align: center; }
.lightbox-close { position: absolute; z-index: 2; top: -12px; right: -12px; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: #1b2530; color: var(--ink); box-shadow: 0 7px 18px rgba(0,0,0,.3); font-size: 0; }
.lightbox-close::before, .lightbox-close::after { content: ""; position: absolute; top: 50%; left: 50%; width: 15px; height: 2px; border-radius: 2px; background: currentColor; transform-origin: center; }
.lightbox-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.lightbox-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.table-image-preview {
  position: fixed;
  z-index: 100;
  width: 230px;
  padding: 8px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #171f29;
  box-shadow: 0 18px 48px rgba(0,0,0,.36);
  pointer-events: none;
  animation: previewIn .14s ease-out;
}
.table-image-preview img { display: block; width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 10px; }
.table-image-preview span { display: block; overflow: hidden; margin-top: 7px; color: var(--ink); font-family: Georgia, serif; font-size: 13px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

@keyframes cardZoomIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes previewIn { from { opacity: 0; transform: translateY(5px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.empty-state { padding: 80px 20px; border: 1px dashed var(--line); border-radius: 15px; background: rgba(23,31,41,.5); text-align: center; }
.empty-state .empty-mark { color: var(--red); font-size: 38px; }
.empty-state h3 { margin: 12px 0 5px; font-family: Georgia, serif; }
.empty-state p { margin: 0; color: var(--muted); }

footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 105px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
footer > span { color: var(--ink); font-family: Georgia, serif; font-size: 15px; font-weight: 700; }
footer button { border: 0; background: transparent; color: var(--muted); font-size: 10px; text-decoration: underline; }
footer button:hover { color: var(--red); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr auto; }
  .status-tabs { grid-column: 1 / -1; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 850px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .status-tabs, .search-control { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  main, footer { width: min(100% - 24px, 1480px); }
  main { padding-top: 18px; }
  .site-header { min-height: 64px; }
  .header-inner { width: calc(100% - 24px); }
  .brand strong { font-size: 21px; }
  .brand-mark { width: 33px; }
  .brand-mark::before { top: 14px; }
  .brand-mark i { top: 9px; left: 9px; width: 11px; height: 11px; }
  .header-meta { font-size: 9px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { min-height: 132px; padding: 16px; }
  .metric-label { font-size: 11px; }
  .metric > strong { margin-top: 17px; font-size: 26px; }
  .metric > p { font-size: 9px; }
  .workspace { padding-top: 50px; }
  .workspace-topline { align-items: flex-start; flex-direction: column; }
  .view-toggle { width: 100%; }
  .view-button { flex: 1; }
  .toolbar { grid-template-columns: 1fr; }
  .status-tabs { width: 100%; overflow-x: auto; }
  .status-tab { flex: 1; }
  .search-control, .status-tabs { grid-column: auto; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .image-frame { width: calc(100% - 14px); margin: 7px; }
  .card-content { padding: 5px 10px 11px; }
  .card-content h3 { font-size: 16px; }
  .card-price strong { font-size: 19px; }
  .card-finance { align-items: flex-start; flex-direction: column; }
  .card-return { text-align: left; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 25px 0; }
  footer p { margin: 0; }
  .lightbox-close { top: 5px; right: 5px; }
}
