:root {
  --bg: #0f1420; --card: #171e2e; --card2: #1d2740; --line: #263252;
  --text: #e8ecf6; --muted: #8b96b5; --acc: #5b8cff; --pos: #3ecf8e; --neg: #ff6b81;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

/* nav */
.topnav {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 17px; color: var(--text); }
.spacer { flex: 1; }

/* buttons */
.btn {
  background: var(--acc); color: #fff; border: 0; padding: 8px 16px;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.btn:hover { filter: brightness(1.1); }

/* login */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card {
  background: var(--card); padding: 36px 40px; border-radius: 14px;
  border: 1px solid var(--line); text-align: center; width: 340px;
}
.login-card h1 { margin: 0 0 4px; }
.login-card input {
  width: 100%; padding: 10px 12px; margin: 14px 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 15px;
}
.error { background: #3a1b24; color: var(--neg); padding: 8px; border-radius: 6px; margin-bottom: 8px; }

/* layout */
main { max-width: 1200px; margin: 20px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
.stats-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr; } }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 6px 8px; border-bottom: 1px solid rgba(38,50,82,.4); }

.banner { background: #233052; border: 1px solid var(--acc); padding: 10px 14px; border-radius: 10px; }

/* forms */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type=text], .filters input:not([type]), .filters select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font-size: 14px;
}
.filters label { color: var(--muted); font-size: 13px; display: flex; gap: 4px; align-items: center; }
.zone-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.zone-form input {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 13px;
}

/* listing grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; color: var(--text); display: flex; flex-direction: column;
  transition: transform .12s ease, border-color .12s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--acc); text-decoration: none; }
.tile-img { position: relative; aspect-ratio: 4/3; background: var(--card2); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { display: grid; place-items: center; height: 100%; color: var(--muted); }
.badge {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
}
.badge.new { background: var(--pos); color: #04150c; }
.badge.chg { background: #ffd166; color: #33260a; top: 34px; }
.tile-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.tile-title { font-weight: 600; font-size: 14.5px; }
.tile-meta { color: var(--muted); font-size: 13px; }
.tile-price { font-size: 16px; font-weight: 700; }
.ppm2 { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.tile-src { color: var(--muted); font-size: 12px; }

/* pager */
.pager { display: flex; gap: 18px; justify-content: center; align-items: center; padding: 12px; }

/* log */
pre.log { max-height: 300px; overflow: auto; font-size: 12.5px; color: var(--muted); white-space: pre-wrap; }

/* detail */
.detail-head { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.detail-head h1 { margin: 0 0 4px; font-size: 24px; }
.big-price { font-size: 22px; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; flex: 1; min-width: 300px; }
.specs div { display: flex; flex-direction: column; }
.specs span { color: var(--muted); font-size: 12px; }
.specs b { font-size: 14px; }
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .detail-cols { grid-template-columns: 1fr; } }

.sib-list { display: flex; flex-direction: column; gap: 10px; }
.sib { display: flex; gap: 12px; align-items: center; color: var(--text); padding: 6px; border-radius: 8px; }
.sib:hover { background: var(--card2); text-decoration: none; }
.sib img { width: 84px; height: 60px; object-fit: cover; border-radius: 6px; }
.sib b { display: block; }
.sib span { color: var(--muted); font-size: 13px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; display: block; }

.desc { white-space: pre-wrap; color: #c9d2e8; }
