:root {
  --bg: #0b0f17;
  --bg-soft: #111827;
  --panel: #151c2c;
  --line: #26304a;
  --text: #e7ecf5;
  --muted: #93a0b8;
  --brand: #e11d2e;
  --brand-soft: rgba(225, 29, 46, 0.12);
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(225, 29, 46, 0.14), transparent 60%),
    radial-gradient(800px 400px at -10% 20%, rgba(59, 130, 246, 0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: inherit; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.5px; text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #ff7a18); font-size: 18px;
}
.logo small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.nav a {
  text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--muted);
  border: 1px solid transparent; transition: all .15s ease;
}
.nav a:hover { color: var(--text); border-color: var(--line); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .1s ease, opacity .15s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-danger { background: rgba(225, 29, 46, 0.12); color: #ff8a94; border-color: rgba(225, 29, 46, 0.35); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 48px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -0.5px; }
.hero h1 span { color: var(--brand); }
.hero p { color: var(--muted); max-width: 560px; margin: 0 0 26px; font-size: 17px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Sections / cards ---------- */
section { padding: 44px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 26px; letter-spacing: -0.3px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.vehicle-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden;
}
.vehicle-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand), #ff7a18); }
.vehicle-card .card-cover { width: calc(100% + 40px); margin: -20px 0 4px -20px; max-height: 190px; object-fit: cover; display: block; border-radius: var(--radius) var(--radius) 0 0; }
.vehicle-card h3 { margin: 0; font-size: 17px; }
.vehicle-card .price { font-size: 22px; font-weight: 800; color: #fff; }
.vehicle-card .meta { color: var(--muted); font-size: 13px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px;
  font-weight: 700; letter-spacing: 0.5px; background: var(--brand-soft); color: #ff8a94;
}
.badge-certified-pre-owned { background: rgba(34, 197, 94, 0.12); color: #6ee7a0; }
.badge-new-arrival { background: rgba(59, 130, 246, 0.14); color: #8ab6ff; }
.badge-great-deal { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.badge-featured { background: rgba(168, 85, 247, 0.14); color: #c99cff; }

/* ---------- Forms ---------- */
form .field { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
label .req { color: var(--brand); }
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #0d1320; color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-error { color: #ff8a94; font-size: 12.5px; margin-top: 5px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checkbox-row label { display: flex; align-items: center; gap: 7px; font-weight: 500; color: var(--text); margin: 0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 16px; height: 16px; }

/* ---------- Feature repeater ---------- */
.feature-row {
  border: 1px dashed var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #0d1320;
}
.feature-row .row-top { display: flex; gap: 10px; align-items: center; }
.feature-row textarea { min-height: 80px; margin-top: 10px; }

/* ---------- Uploaded images ---------- */
.img-manage { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; align-items: flex-start; }
.img-manage img { max-width: 100%; height: auto; }
.img-preview {
  display: block; width: 240px; height: 150px; max-width: 100%;
  object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #0d1320;
}
.img-thumb { width: 132px; max-width: 100%; text-align: center; }
.img-thumb img {
  display: block; width: 132px; height: 92px; max-width: 100%;
  object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #0d1320;
}
.img-remove { font-size: 11.5px; color: var(--muted); font-weight: 500; display: flex; gap: 5px; align-items: center; justify-content: center; margin-top: 4px; }
.img-remove input { width: 13px; height: 13px; accent-color: var(--brand); }
.img-review { margin-top: 10px; }
.img-review-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.img-review-card { position: relative; }
.img-badge {
  display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  background: var(--brand-soft); color: #ffb4ba; border: 1px solid rgba(225, 29, 46, 0.35);
}
.img-filename {
  font-size: 11px; color: var(--muted); margin: 6px 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 132px;
}
.img-remove-btn { width: 100%; margin-top: 2px; }

/* ---------- Alerts / flashes ---------- */
.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.flash-success { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.4); color: #6ee7a0; }
.flash-error { background: rgba(225, 29, 46, 0.1); border-color: rgba(225, 29, 46, 0.4); color: #ff8a94; }

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; }
table.listing { width: 100%; border-collapse: collapse; font-size: 14px; }
table.listing th, table.listing td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.listing th { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
table.listing tr:hover td { background: rgba(255, 255, 255, 0.02); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill-exported { background: rgba(34, 197, 94, 0.12); color: #6ee7a0; }
.pill-pending { background: rgba(245, 158, 11, 0.12); color: #fcd34d; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat .num { font-size: 26px; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0; color: var(--muted); font-size: 13px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .site-header .container { flex-wrap: wrap; }
  .nav { width: 100%; justify-content: flex-start; }
  .hero { padding-top: 44px; }
}
