:root {
  --ink: #141414;
  --ink-2: #4a4a4a;
  --muted: #8a8580;
  --bg: #f6f3ee;
  --card: #ffffff;
  --line: #e4ded4;
  --gold: #a8844c;
  --gold-dark: #8a6a37;
  --danger: #b3261e;
  --ok: #2e7d32;
  --radius: 10px;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px; height: 60px; }
.brand { font-family: var(--serif); font-size: 22px; letter-spacing: .12em; text-decoration: none; font-weight: 700; }
.brand span { color: var(--gold); margin-left: 4px; }
.site-header nav { display: flex; align-items: center; gap: 22px; }
.site-header nav a { text-decoration: none; color: #d8d4cc; font-size: 14px; }
.site-header nav a.active, .site-header nav a:hover { color: #fff; }
#auth-slot { display: flex; align-items: center; gap: 22px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-header nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--ink);
    flex-direction: column; align-items: flex-start; padding: 12px 16px 20px; gap: 14px; }
  .site-header.open nav { display: flex; }
  #auth-slot { flex-direction: column; align-items: flex-start; gap: 14px; }
}
.config-warning { background: #fff4d6; color: #6b4e00; padding: 10px 16px; font-size: 14px; text-align: center; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font: 600 14px var(--sans);
  cursor: pointer; text-decoration: none; }
.btn:hover { background: #000; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-gold { background: var(--gold); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: rgba(127,127,127,.12); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-google { background: #fff; color: #222; border-color: #dadce0; }
.btn-google:hover { background: #f5f5f5; }
.btn-small { padding: 7px 14px; font-size: 13px; }
.btn-wa { background: #1f9d55; border-color: #1f9d55; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font: 15px var(--sans); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; padding: 10px 14px; font-weight: 500; cursor: pointer; margin: 0; }
.radio-row input { width: auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* Hero */
.hero { background: var(--ink); color: #fff; padding: 48px 16px 40px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin-bottom: 10px; }
.hero p { color: #cfc9be; max-width: 560px; margin: 0 auto; }
.hero .gold { color: var(--gold); }

/* Filters */
.filters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 20px; }
.filters .field { margin: 0; }
@media (max-width: 900px) { .filters { grid-template-columns: repeat(2, 1fr); } }
.result-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; color: var(--ink-2); font-size: 14px; }
.result-bar select { width: auto; }

/* Car grid */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.car-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.car-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.car-card .img { aspect-ratio: 4/3; background: #ddd8cf center/cover no-repeat; position: relative; }
.car-card .img .pill { position: absolute; top: 10px; left: 10px; }
.car-card .body { padding: 14px 16px 16px; }
.car-card h3 { font-size: 18px; margin-bottom: 4px; }
.car-card .meta { color: var(--muted); font-size: 13px; }
.car-card .price { font-size: 18px; font-weight: 700; margin-top: 8px; }
.car-card.sold .img { filter: grayscale(.7); }

.badges { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: 11px; font-weight: 600; color: var(--gold-dark); background: #f3ebdc; border-radius: 999px; padding: 3px 9px; }

.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: #eee; color: #444; }
.pill-live { background: #e3f1e4; color: var(--ok); }
.pill-pending { background: #fff1d1; color: #7a5600; }
.pill-changes_requested { background: #ffe4cc; color: #8a3f00; }
.pill-reserved { background: #e3ebf7; color: #24497a; }
.pill-sold { background: var(--ink); color: #fff; }
.pill-rejected { background: #f8dcda; color: var(--danger); }

/* Detail page */
.detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
.gallery-main { aspect-ratio: 4/3; background: #ddd8cf center/contain no-repeat; border-radius: var(--radius); }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.thumbs img { width: 84px; height: 63px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .6; flex: none; }
.thumbs img.active { opacity: 1; outline: 2px solid var(--gold); }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 18px 0; }
.specs div { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.specs dt { font-size: 12px; color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }
.sticky-side { position: sticky; top: 80px; }
.big-price { font-family: var(--serif); font-size: 32px; margin: 4px 0 10px; }
.broker-note { font-size: 13px; color: var(--ink-2); background: #f3ebdc; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }

/* Steps */
.steps { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; }
.steps span { flex: 1; min-width: 90px; text-align: center; font-size: 12px; font-weight: 600; padding: 8px 6px;
  border-bottom: 3px solid var(--line); color: var(--muted); }
.steps span.on { border-color: var(--gold); color: var(--ink); }
.step { display: none; }
.step.on { display: block; }
.step-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.shot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; font-size: 13px;
  color: var(--ink-2); margin: 8px 0 14px; padding: 0; list-style: none; }
.shot-list li::before { content: '◻ '; color: var(--gold); }
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.upload-grid .tile { position: relative; aspect-ratio: 4/3; border-radius: 8px; background: #ddd center/cover; }
.upload-grid .tile button { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 50%; width: 24px; height: 24px;
  background: rgba(0,0,0,.65); color: #fff; cursor: pointer; }
.upload-grid .tile .hero-tag { position: absolute; bottom: 4px; left: 4px; font-size: 10px; background: var(--gold);
  color: #fff; padding: 1px 6px; border-radius: 4px; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; background: #fff; cursor: pointer; }
.dropzone:hover { border-color: var(--gold); }

/* Tables (admin, account) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #faf8f4; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #faf6ee; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: 600 14px var(--sans); color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--gold); }
.tabs .count { background: var(--gold); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 26px; font-family: var(--serif); }
.stat span { font-size: 12px; color: var(--muted); }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--bg); z-index: 41;
  overflow-y: auto; padding: 20px 16px 40px; transform: translateX(100%); transition: transform .2s; }
.drawer.open { transform: none; }
.drawer-bg.open { display: block; }
.drawer .close { float: right; }
.checklist label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.checklist input { width: auto; }

.notice { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.notice-warn { background: #ffe4cc; color: #6b3200; }
.notice-bad { background: #f8dcda; color: #7a1a14; }
.notice-ok { background: #e3f1e4; color: #1d5320; }

.empty { text-align: center; padding: 60px 16px; color: var(--ink-2); }
.empty .btn { margin-top: 10px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--ink);
  color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 60; transition: transform .2s; max-width: calc(100% - 32px); }
#toast.show { transform: translateX(-50%); }
#toast.error { background: var(--danger); }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 16px; border-top: 1px solid var(--line); }
