:root {
  --bg: #0a0e17;
  --bg-2: #111827;
  --bg-3: #1a2334;
  --panel: #111827;
  --panel-2: #1a2334;
  --text: #e8eef7;
  --text-dim: #8fa3c0;
  --muted: #8fa3c0;
  --neon: #37f1ff;
  --neon-dim: rgba(55, 241, 255, 0.14);
  --neon-2: #ffb347;
  --accent: #37f1ff;
  --accent-2: #ffb347;
  --danger: #ff5f6d;
  --ok: #5ef38c;
  --border: #263552;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(55, 241, 255, 0.10), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(255, 179, 71, 0.06), transparent 35%),
    var(--bg);
  background-attachment: fixed;
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.5;
}

a { color: var(--neon); }

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(55, 241, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 241, 255, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 75%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 22px;
  background: rgba(10, 14, 23, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: .06em;
  text-decoration: none;
  color: var(--text);
}
.logo-icon { font-size: 1.5rem; filter: drop-shadow(0 0 8px rgba(55,241,255,.6)); }
.logo-accent { color: var(--neon); text-shadow: 0 0 14px rgba(55,241,255,.7); }

.topnav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.topnav a {
  text-decoration: none;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  transition: background .15s, border-color .15s;
  border: 1px solid transparent;
}
.topnav a:hover { background: var(--neon-dim); border-color: rgba(55,241,255,.35); }
.topnav .btn { border: 1px solid transparent; }
.nav-account { color: var(--neon); font-weight: 700; }
.nav-logout, .nav-admin { color: var(--muted); font-size: 1.05rem; padding: 8px 10px; }
.nav-logout:hover, .nav-admin:hover { color: var(--danger); }

.container { max-width: 1240px; margin: 24px auto; padding: 0 18px 48px; position: relative; z-index: 1; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 0;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    linear-gradient(120deg, rgba(10, 16, 30, 0.97), rgba(16, 26, 44, 0.95) 55%, rgba(13, 22, 38, 0.97)),
    linear-gradient(35deg, rgba(55, 241, 255, 0.10), rgba(255, 179, 71, 0.07));
  margin-bottom: 22px;
}
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 30px 22px; }
.hero-text { max-width: 640px; }
.hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  margin: 0 0 10px;
  letter-spacing: .01em;
}
.hero p { color: var(--muted); font-size: 1.08rem; margin: 0 0 18px; }
.hero-drone { font-size: clamp(70px, 12vw, 130px); filter: drop-shadow(0 0 30px rgba(55,241,255,.45)); animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(3deg); } }
/* Each propeller rotates around its own center */
.hero-drone .prop-tl { transform-origin: 14px 14px; animation: spin 0.8s linear infinite; }
.hero-drone .prop-tr { transform-origin: 50px 14px; animation: spin 0.6s linear infinite; }
.hero-drone .prop-bl { transform-origin: 14px 50px; animation: spin 0.7s linear infinite; }
.hero-drone .prop-br { transform-origin: 50px 50px; animation: spin 0.5s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.hero-search {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.hero-search input[type="search"] {
  flex: 1;
  min-width: 160px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
}
.hero-search input[type="search"]:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-dim); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-catstrip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 30px 22px;
}
.cat-chip {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: .92rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--bg-3);
  transition: border-color .15s, background .15s, transform .15s;
  white-space: nowrap;
}
.cat-chip:hover { border-color: var(--neon); background: var(--neon-dim); transform: translateY(-1px); }
.cat-count {
  display: inline-block;
  margin-left: 6px;
  font-size: .8rem;
  color: var(--neon);
  background: rgba(55,241,255,.12);
  border-radius: 999px;
  padding: 1px 8px;
}

/* Panels */
.panel {
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.96), rgba(11, 16, 27, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.35rem; }
.panel h2 { font-size: 1.35rem; margin-top: 0; }

h1, h2, h3 { font-family: "Orbitron", sans-serif; font-weight: 700; margin-top: 0; letter-spacing: .01em; }
h1 { font-size: 1.7rem; }
h3 { font-size: 1.1rem; }

/* Cards */
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(55, 241, 255, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(55,241,255,.25);
}
.card-media { display: block; position: relative; aspect-ratio: 16 / 10; background: var(--bg-3); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-media-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: "Orbitron", sans-serif;
  font-size: 1.6rem; font-weight: 900; letter-spacing: .1em;
  color: rgba(55, 241, 255, 0.35);
  background:
    linear-gradient(135deg, rgba(55,241,255,.08), transparent 60%),
    repeating-linear-gradient(45deg, rgba(55,241,255,.05) 0 12px, transparent 12px 24px);
}
.card-sold { opacity: .88; }
.badge {
  position: absolute; top: 10px; right: 10px;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  backdrop-filter: blur(4px);
}
.badge-sold { color: var(--ok); border-color: rgba(94,243,140,.5); }
.fav-btn {
  position: absolute; top: 10px; left: 10px;
  z-index: 2;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform .15s, border-color .15s, box-shadow .15s;
  padding: 0;
}
.fav-btn:hover { transform: scale(1.15); border-color: var(--neon); box-shadow: 0 0 12px rgba(255,95,160,.4); }
.fav-btn.fav-active { border-color: rgba(255,95,160,.6); box-shadow: 0 0 10px rgba(255,95,160,.3); }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-price {
  font-family: "Orbitron", sans-serif;
  font-size: 1.25rem; font-weight: 700;
  color: var(--neon-2);
  text-shadow: 0 0 16px rgba(255,179,71,.35);
}
.card-title { font-size: 1rem; margin: 0; line-height: 1.3; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--neon); }
.meta { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.meta-loc { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-distance { color: var(--neon); font-weight: 700; white-space: nowrap; }
.seller { color: var(--text); text-decoration: none; }
.seller:hover { color: var(--neon); text-decoration: underline; }
.meta-time { margin-left: auto; white-space: nowrap; }

.chip {
  display: inline-block;
  font-size: .78rem; font-weight: 700;
  color: var(--neon);
  background: var(--neon-dim);
  border: 1px solid rgba(55,241,255,.35);
  border-radius: 999px;
  padding: 2px 10px;
  text-transform: lowercase;
}

/* Buttons */
.btn {
  display: inline-block;
  border: 1px solid #41598a;
  padding: 10px 18px;
  border-radius: 11px;
  color: var(--text);
  background: linear-gradient(145deg, var(--bg-3), var(--bg-2));
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { border-color: var(--neon); box-shadow: 0 0 14px rgba(55,241,255,.25); }
.btn:active { transform: scale(.98); }
.btn-primary {
  border-color: rgba(55,241,255,.6);
  background: linear-gradient(145deg, var(--neon-dim), transparent), var(--bg-2);
  color: #d9fbff;
}
.btn-primary:hover { box-shadow: 0 0 18px rgba(55,241,255,.4); }
.btn-danger { border-color: #7a2533; background: linear-gradient(145deg, #451824, #2b0e15); color: #ffd7db; }
.btn-ok { border-color: var(--ok); background: linear-gradient(145deg, rgba(94, 243, 140, 0.2), rgba(94, 243, 140, 0.05)); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 9px; }

/* Forms */
.input, input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="email"], input[type="file"], textarea, select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: 11px;
  font-family: inherit;
  font-size: .98rem;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-dim);
}
::placeholder { color: #5b6f92; }
textarea { min-height: 130px; resize: vertical; }
label { display: block; margin: 14px 0 6px; color: var(--muted); font-weight: 700; font-size: .92rem; }
input[type="file"] { padding: 8px; }

/* Flash */
.flash {
  padding: 12px 16px;
  border-radius: 11px;
  margin-bottom: 14px;
  font-weight: 600;
  animation: flash-in .25s ease;
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash.err { background: rgba(255, 95, 109, 0.13); border: 1px solid rgba(255,95,109,.55); color: #ffd3d8; }
.flash.ok { background: rgba(94, 243, 140, 0.12); border: 1px solid rgba(94,243,140,.5); color: #d8ffe7; }

/* Empty state */
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-icon { font-size: 3rem; margin-bottom: 8px; }
.empty-state p { font-size: 1.1rem; margin: 0 0 14px; }

/* Map */
.map { width: 100%; height: 540px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-3); }
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}
.filters label { margin-top: 0; }
.filters .btn { width: 100%; }

/* Listing view */
.listing-layout { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: 18px; }
.gallery-main { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/10; background: var(--bg-3); margin-bottom: 10px; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 88px; height: 64px; object-fit: cover; border-radius: 8px;
  border: 2px solid transparent; cursor: pointer; padding: 0;
}
.gallery-thumbs img.active { border-color: var(--neon); }
.price-block {
  font-family: "Orbitron", sans-serif;
  font-size: 2rem; font-weight: 900;
  color: var(--neon-2);
  text-shadow: 0 0 20px rgba(255,179,71,.35);
  margin: 6px 0 12px;
}
.info-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(144,164,194,.12); }
.info-row .info-key { color: var(--muted); min-width: 130px; font-weight: 700; }
.description { white-space: pre-line; line-height: 1.6; }
.params-list { list-style: none; padding: 0; margin: 0; }
.params-list li {
  padding: 8px 12px; margin-bottom: 6px;
  background: rgba(55,241,255,.05);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.params-list li strong { color: var(--neon); margin-right: 8px; }
.seller-box {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg-2);
}
.seller-link { text-decoration: none; color: var(--text); }
.seller-link:hover { color: var(--neon); }

/* Rating stars */
.rating { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--fg); }
.rating-stars { color: var(--neon); letter-spacing: 2px; font-size: 15px; }
.rating-num { color: var(--neon); }
.rating-count { color: var(--muted); font-weight: 400; font-size: 12px; }
.rating-empty { color: var(--muted); font-weight: 400; font-size: 13px; }
.ratings-list { display: flex; flex-direction: column; gap: 10px; }
.rating-item {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}
.rating-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rating-item-stars { color: var(--neon); letter-spacing: 2px; font-size: 15px; }
.rating-item-meta { color: var(--muted); font-size: 13px; }
.rating-item-meta strong { color: var(--fg); }
.rating-item-comment { margin: 8px 0 0; color: var(--fg); font-size: 14px; line-height: 1.5; }

/* Rating modal */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 6, 10, 0.7); backdrop-filter: blur(2px); }
.modal-dialog {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(480px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--fg); }
.modal-body { padding: 16px 18px; }
.modal-body form label { display: block; margin: 12px 0 6px; font-weight: 600; font-size: 13px; }
.modal-body form input[type=text], .modal-body form textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
}
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }

.star-picker { display: flex; gap: 4px; }
.star-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  font-size: 24px; line-height: 1; padding: 4px 8px; border-radius: 8px;
  cursor: pointer; transition: all .12s;
}
.star-btn:hover { color: var(--neon); border-color: var(--neon); }
.star-btn.star-on { color: var(--neon); border-color: var(--neon); background: rgba(34,238,135,.1); }

/* Badges in nav */
.nav-account, .nav-logout { position: relative; }
.nav-badge {
  position: absolute; top: -6px; right: -10px;
  background: var(--accent); color: #06111f;
  font-size: 10px; font-weight: 800; line-height: 1;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.nav-badge.hidden { display: none; }

/* Price filters */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filter-bar label { font-size: 13px; color: var(--muted); }
.filter-bar input[type=number] {
  width: 110px; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--fg); padding: 6px 10px; border-radius: 8px; font: inherit;
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none; border: 1px solid var(--line); color: var(--fg);
  font-size: 18px; padding: 4px 10px; border-radius: 8px; cursor: pointer;
}
@media (max-width: 720px) {
  .menu-toggle { display: inline-flex; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: 100%; right: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; gap: 8px; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
}
.seller-profile { margin-bottom: 6px; }
.seller-profile-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
}
.seller-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: "Orbitron", sans-serif;
  font-size: 2rem; font-weight: 900;
  color: #d9fbff;
  background: linear-gradient(145deg, rgba(55,241,255,.35), rgba(55,241,255,.1));
  border: 2px solid rgba(55,241,255,.5);
  box-shadow: 0 0 20px rgba(55,241,255,.25);
  flex-shrink: 0;
}
.seller-info { flex: 1; min-width: 0; }
.seller-info h1 { margin: 0 0 4px; font-size: 1.5rem; }
.seller-info .meta { margin: 2px 0; }
.seller-stats { display: flex; gap: 16px; margin-top: 8px; }
.seller-stats .stat { color: var(--muted); font-size: .95rem; }
.seller-stats .stat strong { color: var(--neon); font-size: 1.15rem; }

.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; }

/* Images (edit page) */
.images { display: flex; gap: 10px; flex-wrap: wrap; }
.image-item { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.image-item img { width: 130px; height: 95px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }
.image-item label { margin: 0; color: var(--muted); font-size: .85rem; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(144,164,194,.15); font-size: .93rem; }
thead th {
  background: rgba(55,241,255,.07);
  color: var(--neon);
  font-family: "Orbitron", sans-serif;
  font-size: .78rem;
  letter-spacing: .06em;
  white-space: nowrap;
}
tbody tr:hover { background: rgba(55,241,255,.04); }
.status-pill {
  display: inline-block;
  font-size: .8rem; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--border);
}
.status-active { color: var(--ok); border-color: rgba(94,243,140,.45); }
.status-hidden { color: var(--neon-2); border-color: rgba(255,179,71,.45); }
.status-sold { color: var(--muted); border-color: rgba(144,164,194,.4); }

/* Actions row */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Messages */
.messages-grid { display: grid; grid-template-columns: minmax(250px, 320px) 1fr; gap: 16px; }
.conv-list { display: flex; flex-direction: column; gap: 8px; }
.conv-item {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  background: var(--bg-2);
  transition: border-color .15s, background .15s;
}
.conv-item:hover { border-color: rgba(55,241,255,.45); }
.conv-item.active { border-color: var(--neon); background: var(--neon-dim); }
.conv-title { font-weight: 700; font-size: .95rem; }
.conv-meta { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.chat-box {
  max-height: 420px; overflow: auto;
  border: 1px solid var(--border);
  padding: 14px; border-radius: 12px;
  background: rgba(8, 12, 21, 0.7);
  display: flex; flex-direction: column; gap: 10px;
}
.msg { max-width: 78%; padding: 9px 13px; border-radius: 13px; font-size: .95rem; }
.msg .msg-meta { display: block; margin-top: 4px; font-size: .72rem; color: var(--muted); }
.msg-in { align-self: flex-start; background: var(--bg-3); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-out { align-self: flex-end; background: rgba(55,241,255,.14); border: 1px solid rgba(55,241,255,.4); border-bottom-right-radius: 4px; }
.chat-form { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 140px; }

/* Auth pages */
.auth-panel { max-width: 520px; margin: 30px auto; }
.auth-panel h1 { margin-bottom: 4px; }
.auth-sub { color: var(--muted); margin: 0 0 14px; }
.auth-alt { margin-top: 16px; text-align: center; color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 20px;
  background: rgba(8, 12, 20, 0.85);
  position: relative; z-index: 1;
}
.site-footer .container {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 0; padding: 0 18px;
  color: var(--muted); font-size: .9rem;
}

/* Misc */
.status-ok { color: var(--ok); }
.status-err { color: var(--danger); }
.muted { color: var(--muted); }
.spacer { height: 14px; }

/* Leaflet dark tint */
.leaflet-container { background: var(--bg-3); font-family: "Rajdhani", sans-serif; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg-2); color: var(--text); box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.leaflet-popup-content { margin: 12px 14px; font-size: .92rem; }

/* Responsive */
@media (max-width: 900px) {
  .listing-layout { grid-template-columns: 1fr; }
  .messages-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .topnav { justify-content: center; }
  .hero-inner { flex-direction: column; text-align: center; padding: 26px 18px 16px; }
  .hero-search, .hero-actions { justify-content: center; }
  .hero-catstrip { justify-content: center; padding: 0 18px 18px; }
  .hero-drone { display: none; }
  .map { height: 380px; }
  .info-row .info-key { min-width: 0; width: 100%; border-bottom: 0; }
  .info-row { flex-direction: column; gap: 2px; }
}

/* Admin stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.stat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Image hover preview */
.image-hover-preview {
    position: fixed;
    z-index: 1000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--accent);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    pointer-events: none;
}

.image-hover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* NEW badge */
.badge-new {
    background: linear-gradient(135deg, #ff6b35, #ff2e63);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

/* Share button */
.btn-share {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.85rem;
}

.btn-share:hover {
    background: rgba(55,241,255,0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 4px;
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 500;
}

/* Gallery active state */
.gallery-thumbs img.active {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(55,241,255,0.3);
}

/* Responsive card grid for mobile */
@media (max-width: 600px) {
    .grid.cards {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .image-hover-preview {
        display: none;
    }
    
    .breadcrumbs {
        font-size: 0.7rem;
    }
}

/* ============ Light Mode ============ */
html[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-2: #ffffff;
  --bg-3: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f5f7fa;
  --text: #1a202c;
  --text-dim: #4a5568;
  --muted: #718096;
  --neon: #0ea5e9;
  --neon-dim: rgba(14, 165, 233, 0.12);
  --neon-2: #f59e0b;
  --accent: #0ea5e9;
  --accent-2: #f59e0b;
  --danger: #ef4444;
  --ok: #10b981;
  --border: #e2e8f0;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 15% 0%, rgba(14, 165, 233, 0.08), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(245, 158, 11, 0.05), transparent 35%),
    var(--bg);
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .card {
  background: var(--bg-2);
  border-color: var(--border);
}

html[data-theme="light"] .panel {
  background: var(--bg-2);
  border-color: var(--border);
}

html[data-theme="light"] .hero {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.97), rgba(245, 247, 250, 0.95) 55%, rgba(238, 241, 245, 0.97)),
    linear-gradient(35deg, rgba(14, 165, 233, 0.08), rgba(245, 158, 11, 0.05));
}

html[data-theme="light"] .cat-chip,
html[data-theme="light"] a.cat-chip {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="light"] .cat-chip:hover,
html[data-theme="light"] a.cat-chip:hover {
  background: var(--neon-dim) !important;
  border-color: var(--neon) !important;
}

html[data-theme="light"] button {
  background: var(--bg-2);
  color: var(--text);
}

html[data-theme="light"] button:hover {
  background: var(--bg-3);
}

html[data-theme="light"] a {
  color: var(--neon);
}

html[data-theme="light"] a.btn {
  background: var(--bg-2);
  color: var(--text);
}

html[data-theme="light"] a.btn-primary,
html[data-theme="light"] a.btn.btn-primary {
  background: var(--neon) !important;
  color: #ffffff !important;
}

html[data-theme="light"] a.btn-primary:hover,
html[data-theme="light"] a.btn.btn-primary:hover {
  background: var(--accent-2) !important;
}

html[data-theme="light"] a.btn,
html[data-theme="light"] a.btn-primary {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="light"] .btn {
  color: var(--text);
}

html[data-theme="light"] .btn-neon {
  background: linear-gradient(145deg, var(--neon), var(--accent-2));
  color: #ffffff;
}

html[data-theme="light"] .btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="light"] .btn-danger {
  background: linear-gradient(145deg, var(--danger), #dc2626);
  color: #ffffff;
}

html[data-theme="light"] .btn-ok {
  background: linear-gradient(145deg, var(--ok), #059669);
  color: #ffffff;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="light"] .menu-toggle {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="light"] .modal-dialog {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="light"] .modal-close {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="light"] .star-btn {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-dim);
}

html[data-theme="light"] .search-bar input {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="light"] .hero-search input {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border);
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* ============ Quick Search (Ctrl+K) ============ */
.quick-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}
.quick-search-overlay[hidden] { display: none; }
.quick-search {
    width: 90%;
    max-width: 500px;
    background: var(--bg-2);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.quick-search input {
    width: 100%;
    font-size: 1.1rem;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid var(--accent);
    background: var(--bg-3);
    color: var(--text);
    outline: none;
}
.quick-search-hint {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
}

/* ============ QR Modal ============ */
.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    cursor: pointer;
}
.qr-content {
    position: relative;
    background: var(--bg-2);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.qr-content img {
    margin: 16px 0;
    border-radius: 8px;
}

/* ============ Top Sellers ============ */
.top-sellers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.seller-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--bg-3);
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s;
}
.seller-card:hover {
    background: var(--bg-2);
}
.seller-rank {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent);
    min-width: 40px;
    text-align: center;
}
.seller-info {
    flex: 1;
}
.seller-rating {
    margin-top: 4px;
}
.seller-sold {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ============ Price Chart ============ */
.price-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.price-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.price-cat {
    min-width: 120px;
    font-size: 0.9rem;
    color: var(--text-dim);
}
.price-bar {
    flex: 1;
    height: 24px;
    background: var(--bg-3);
    border-radius: 6px;
    overflow: hidden;
}
.price-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 6px;
    transition: width 0.5s ease;
}
.price-value {
    min-width: 100px;
    text-align: right;
    font-weight: 700;
    color: var(--text);
}

/* ============ Pinned Categories ============ */
.cat-chip-pinned {
    border-color: var(--accent);
    background: rgba(247,148,30,0.1);
}
.cat-chip[title="Kliknij PPM aby przypiąć/odpinać"] {
    cursor: pointer;
}

/* ============ Compare Bar ============ */
.compare-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-2);
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    z-index: 100;
}
.compare-bar[hidden] { display: none; }
.compare-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============ Recently Viewed ============ */
.recently-viewed {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.recently-viewed .card {
    min-width: 200px;
    max-width: 200px;
}

/* ============ Compare Page ============ */
.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.compare-item {
    background: var(--bg-2);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
}
.compare-item h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}
.compare-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.compare-row:last-child {
    border-bottom: none;
}
.compare-label {
    color: var(--muted);
    font-size: 0.9rem;
}
.compare-value {
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

/* ============ Tags ============ */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.tag {
    padding: 4px 10px;
    background: var(--bg-3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-dim);
}
.tag:hover {
    background: var(--accent);
    color: #fff;
}

/* ============ Compare Checkbox ============ */
.compare-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}
.compare-check input {
    cursor: pointer;
    accent-color: var(--accent);
}
.compare-check:hover {
    color: var(--accent);
}

/* ============ FINAL LIGHT MODE OVERRIDES ============ */
/* These must be at the end to win specificity battles */

html[data-theme="light"] a.cat-chip,
html[data-theme="light"] .cat-chip {
    background: #ffffff !important;
    color: #1a202c !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] a.cat-chip:hover {
    background: rgba(14, 165, 233, 0.12) !important;
    border-color: #0ea5e9 !important;
}

html[data-theme="light"] a.btn-primary,
html[data-theme="light"] .btn-primary {
    background: linear-gradient(145deg, #0ea5e9, #f59e0b) !important;
    color: #ffffff !important;
}

html[data-theme="light"] a.btn-primary:hover {
    background: linear-gradient(145deg, #0284c7, #d97706) !important;
}

html[data-theme="light"] .btn,
html[data-theme="light"] button {
    background: #ffffff !important;
    color: #1a202c !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .btn:hover,
html[data-theme="light"] button:hover {
    background: #f5f7fa !important;
}

html[data-theme="light"] .card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .panel,
html[data-theme="light"] .modal-dialog {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #1a202c !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background: #ffffff !important;
    color: #1a202c !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: #718096 !important;
}









/* ============ ABSOLUTE FINAL OVERRIDES (V8) ============ */

html[data-theme="light"] a.btn.btn-primary,
html[data-theme="light"] a.btn-primary {
    background: linear-gradient(145deg, #0ea5e9, #f59e0b) !important;
    color: #ffffff !important;
}

html[data-theme="light"] a.btn.btn-primary:hover,
html[data-theme="light"] a.btn-primary:hover {
    background: linear-gradient(145deg, #0284c7, #d97706) !important;
}

html[data-theme="light"] .btn,
html[data-theme="light"] button.btn {
    background: #ffffff !important;
    color: #1a202c !important;
    border-color: #e2e8f0 !important;
}
