:root {
  --bg: #0b0f14;
  --panel: #121922;
  --panel-2: #18212c;
  --border: #243140;
  --text: #d7e0ea;
  --muted: #7d8b9a;
  --accent: #d9a441;
  --accent-2: #f0bd5a;
  --bpo: #4fb3ff;
  --bpc: #c88cff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: 1px; text-transform: uppercase; }
.brand span { color: var(--accent); }
.user { display: flex; align-items: center; gap: 10px; }
.user img { width: 32px; height: 32px; border-radius: 4px; }

main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 16px; flex: 1; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}
.center { text-align: center; max-width: 560px; margin: 60px auto; padding: 32px; }
.center h1 { margin-top: 0; }

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: wait; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.big { padding: 12px 24px; font-size: 16px; margin: 8px 0 16px; }

.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stats { margin-left: auto; font-weight: 600; }
.pricestatus { width: 100%; }
.pricestatus:empty { display: none; }

.filters { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-bottom: 14px; }
.filters label { display: flex; align-items: center; gap: 6px; }
select, input[type="search"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
}
input[type="search"] { flex: 1; min-width: 180px; }

.copyhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.copyhead .btn { margin-left: auto; }
textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  background: #070a0e;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  font: 13px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace;
  white-space: pre;
}

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; position: sticky; top: 0; background: var(--panel); }
td img { display: block; border-radius: 3px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.loc { color: var(--muted); font-size: 12px; }
td.price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.price .sub { display: block; color: var(--muted); font-size: 11px; }
td.price.nearest { color: var(--muted); }
td.tag { font-weight: 700; font-size: 12px; }
td.tag.bpo { color: var(--bpo); }
td.tag.bpc { color: var(--bpc); }
tbody tr:hover { background: var(--panel-2); }

footer { text-align: center; padding: 16px; }

@media (max-width: 640px) {
  .stats { margin-left: 0; width: 100%; }
  td.loc, th:last-child { display: none; }
}
