@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0a0c10;
  --surface: #12151c;
  --surface-2: #1a1e27;
  --line: #262b35;
  --text: #edeff2;
  --text-dim: #838b99;
  --accent: #3fae44;
  --accent-dim: #2c6b30;
  --accent-2: #35d0ba;
  --danger: #e5484d;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.01em;
  margin: 0;
}
.mono { font-family: 'IBM Plex Mono', monospace; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,12,16,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk'; font-weight: 700; font-size: 19px; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }
.brand img.logo-mark { height: 30px; width: auto; display: block; }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--text-dim); }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  padding: 9px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
}
.nav-cta:hover { border-color: var(--accent-dim); }

/* ---------- Ticker (signature element) ---------- */
.ticker {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden; white-space: nowrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px; color: var(--text-dim);
}
.ticker-track { display: inline-flex; gap: 40px; padding: 8px 0; animation: scroll 38s linear infinite; }
.ticker span.up { color: var(--accent-2); }
.ticker span.pending { color: var(--accent); }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 48px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.eyebrow { font-family: 'IBM Plex Mono'; font-size: 12.5px; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 14px; }
.hero h1 { font-size: 46px; line-height: 1.08; font-weight: 700; }
.hero p.lead { color: var(--text-dim); font-size: 16px; max-width: 46ch; margin-top: 18px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 8px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #14100a; }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent-dim); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-accept { background: var(--accent-2); color: #062521; }

/* quote card in hero */
.quote-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
}
.quote-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); font-family: 'IBM Plex Mono'; font-size: 13.5px; }
.quote-row:last-child { border-bottom: none; }
.quote-row .name { color: var(--text-dim); }
.quote-row .val { color: var(--accent-2); }

/* ---------- Section headers ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; }
.section-head p { color: var(--text-dim); font-size: 14px; margin-top: 6px; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.filters input, .filters select {
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 10px 14px; border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.filters input { flex: 1; min-width: 180px; }

/* ---------- Product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card-img {
  aspect-ratio: 1/1; background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line); position: relative;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-device {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-dim);
}
.placeholder-device .glyph {
  width: 46px; height: 46px; border: 2px solid var(--accent-dim); border-radius: 9px; position: relative;
}
.placeholder-device .glyph::after { content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 12px; height: 2px; background: var(--accent-dim); border-radius: 2px; }
.placeholder-device .lbl { font-family: 'IBM Plex Mono'; font-size: 10.5px; text-align: center; padding: 0 10px; }

.card-body { padding: 14px 16px 16px; }
.card-tag { display: inline-block; font-family: 'IBM Plex Mono'; font-size: 10.5px; color: var(--accent); border: 1px solid var(--accent-dim); padding: 2px 7px; border-radius: 20px; margin-bottom: 8px; }
.card-title { font-weight: 600; font-size: 14.5px; margin-bottom: 2px; }
.card-sub { color: var(--text-dim); font-size: 12.5px; margin-bottom: 10px; }
.card-price { font-family: 'IBM Plex Mono'; font-size: 17px; color: var(--text); font-weight: 500; }
.card-price small { color: var(--text-dim); font-size: 11px; font-weight: 400; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); font-family: 'IBM Plex Mono'; font-size: 13.5px; border: 1px dashed var(--line); border-radius: 12px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--text-dim); font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(4,5,7,0.72); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 440px;
  padding: 26px; max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-size: 19px; margin-bottom: 4px; }
.modal .sub { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; font-family: 'IBM Plex Mono'; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 13px; border-radius: 8px; font-size: 14px; font-family: inherit;
}
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-close { position: absolute; top: 18px; right: 20px; background: none; border: none; color: var(--text-dim); font-size: 20px; }
.modal-inner { position: relative; }
.helper { font-size: 12px; color: var(--text-dim); margin-top: 10px; line-height: 1.5; }

/* ---------- Product detail ---------- */
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 48px 0; }
.pd-img { aspect-ratio: 1/1; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pd-tag { font-family: 'IBM Plex Mono'; font-size: 12px; color: var(--accent); border: 1px solid var(--accent-dim); display: inline-block; padding: 3px 9px; border-radius: 20px; margin-bottom: 14px; }
.pd-title { font-size: 30px; margin-bottom: 6px; }
.pd-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 22px; }
.pd-price { font-family: 'IBM Plex Mono'; font-size: 32px; margin-bottom: 4px; }
.pd-price-lbl { color: var(--text-dim); font-size: 12px; font-family: 'IBM Plex Mono'; margin-bottom: 26px; }
.specs { border-top: 1px solid var(--line); margin-top: 26px; }
.spec-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.spec-row .k { color: var(--text-dim); font-family: 'IBM Plex Mono'; }
.pd-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ---------- Sell / trade page ---------- */
.form-page { max-width: 620px; margin: 0 auto; padding: 56px 24px; }
.type-toggle { display: flex; gap: 10px; margin-bottom: 28px; }
.type-toggle button {
  flex: 1; padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-dim);
  font-weight: 600; font-size: 14px; text-align: left;
}
.type-toggle button .tt-desc { display: block; font-weight: 400; font-size: 12px; margin-top: 4px; }
.type-toggle button.active { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.dropzone {
  border: 1px dashed var(--line); border-radius: 10px; padding: 22px; text-align: center; color: var(--text-dim);
  font-size: 13px; cursor: pointer; margin-bottom: 4px;
}
.dropzone:hover { border-color: var(--accent-dim); }
.thumb-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.thumb-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--accent-dim); color: var(--text);
  padding: 13px 20px; border-radius: 10px; font-size: 13.5px; opacity: 0; transition: all .25s ease; z-index: 200;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid, .pd-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .hero h1 { font-size: 34px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .field-row { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  * { transition: none !important; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Admin ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; border-right: 1px solid var(--line); padding: 22px 16px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.admin-side .brand { margin-bottom: 24px; padding-left: 8px; }
.admin-tab {
  padding: 10px 12px; border-radius: 8px; color: var(--text-dim); font-size: 14px; font-weight: 500;
  border: none; background: none; text-align: left; display: flex; justify-content: space-between; align-items: center;
}
.admin-tab:hover { background: var(--surface); }
.admin-tab.active { background: var(--surface-2); color: var(--text); }
.admin-tab .count { font-family: 'IBM Plex Mono'; font-size: 11px; color: var(--accent); }
.admin-main { flex: 1; padding: 32px 36px; max-width: 1100px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.admin-head h2 { font-size: 22px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--text-dim); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--line); font-family: 'IBM Plex Mono'; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--surface); }
.status-pill { font-family: 'IBM Plex Mono'; font-size: 10.5px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); text-transform: uppercase; }
.status-pill.pending { color: var(--accent); border-color: var(--accent-dim); }
.status-pill.accepted { color: var(--accent-2); border-color: var(--accent-2); }
.status-pill.rejected { color: var(--danger); border-color: var(--danger); }
.thumb-sm { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.row-actions { display: flex; gap: 6px; }
.upload-box {
  border: 1px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center; margin-bottom: 26px;
  background: var(--surface);
}
.upload-box input[type=file] { margin-top: 12px; }
.stat-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.stat-card .num { font-family: 'IBM Plex Mono'; font-size: 26px; color: var(--accent-2); }
.stat-card .lbl { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.photo-strip { display: flex; gap: 6px; }
.photo-strip img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
@media (max-width: 760px) {
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .stat-cards { grid-template-columns: 1fr; }
}

