:root {
  --navy: #14142b; --navy-2: #22223f; --gold: #d4af6a; --gold-2: #b8914a;
  --bg: #f5f5f7; --card: #fff; --text: #1c1c28; --muted: #6b6b7b; --line: #e4e4ea;
  --ok: #1a8f5a; --warn: #b87a00; --bad: #c0392b; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--navy); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }

/* header */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .3px; white-space: nowrap; }
.brand .crown { color: var(--gold); }
.brand small { color: var(--gold); font-weight: 500; margin-left: 4px; }
.links { display: flex; gap: 18px; align-items: center; }
.links a { color: #e8e8f0; text-decoration: none; font-weight: 500; }
.links a:hover { color: var(--gold); }
.links .admin-link { color: var(--gold); }
.burger { display: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
@media (max-width: 860px) {
  .burger { display: block; }
  .links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); flex-direction: column; padding: 12px 16px 18px; align-items: flex-start; }
  #menu-toggle:checked ~ .links { display: flex; }
}
.subnav { background: var(--navy-2); }
.subnav .wrap { display: flex; gap: 20px; overflow-x: auto; height: 42px; align-items: center; }
.subnav a { color: #cfcfe0; text-decoration: none; white-space: nowrap; font-size: .92rem; }
.subnav a:hover { color: var(--gold); }
.notice-bar { background: #fff6e0; color: #6a4a00; text-align: center; padding: 10px 16px; font-size: .93rem; border-bottom: 1px solid #f0dca8; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 8px; padding: 11px 18px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--navy); color: #fff; }
.btn:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); color: var(--navy); } .btn.gold:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn.ok { background: var(--ok); } .btn.bad { background: var(--bad); }
.btn.sm { padding: 7px 12px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn.google { background: #fff; color: #333; border: 1px solid #dadce0; }
.btn.google:hover { background: #f7f8f8; }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .92rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel],
input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
textarea { min-height: 120px; }
.help { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 20px; }
.auth-card { max-width: 440px; margin: 20px auto; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.alert.success { background: #e9f7ef; border-color: #b5e2c8; color: #145c3b; }
.alert.error { background: #fdecea; border-color: #f5c2bd; color: #8a241a; }
.alert.info { background: #eef1fb; border-color: #cbd3f0; color: #2a3570; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: #e3f5ec; color: var(--ok); } .badge.warn { background: #fff2d6; color: var(--warn); }
.badge.bad { background: #fde5e2; color: var(--bad); } .badge.muted { background: #ececf1; color: var(--muted); }

/* hero */
.hero { background: linear-gradient(135deg, var(--navy), #2c2c55); color: #fff; border-radius: var(--radius); padding: 34px 28px; margin-bottom: 24px; }
.hero h1 { font-size: 2rem; } .hero p { color: #d9d9e8; max-width: 640px; margin: 0; }
.hero .gold-text { color: var(--gold); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.steps div { background: rgba(255,255,255,.07); border-radius: 10px; padding: 12px; font-size: .9rem; color: #e7e7f2; }
.steps b { color: var(--gold); display: block; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr 1fr; } .hero h1 { font-size: 1.5rem; } }

/* car grid */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 500; }
.tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.car-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.car-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,20,43,.1); }
.car-card .img { aspect-ratio: 16/10; background: #e9e9ef center/cover no-repeat; position: relative; }
.car-card .img .badge { position: absolute; top: 10px; left: 10px; }
.car-card .body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.car-card .title { font-weight: 700; font-size: 1.05rem; }
.car-card .meta { color: var(--muted); font-size: .88rem; }
.car-card .price-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.price { font-size: 1.2rem; font-weight: 700; color: var(--navy); }
.label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.countdown { font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown.soon { color: var(--bad); }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* car detail */
.detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } .detail .bidbox { order: -1; position: static; } }
.gallery .main-img { aspect-ratio: 16/10; background: #e9e9ef center/cover no-repeat; border-radius: var(--radius); }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery .thumbs img { width: 90px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .7; border: 2px solid transparent; }
.gallery .thumbs img.active, .gallery .thumbs img:hover { opacity: 1; border-color: var(--gold); }
.bidbox { position: sticky; top: 84px; }
.bidbox .big { font-size: 2rem; font-weight: 800; color: var(--navy); }
.stat { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.bid-form { display: flex; gap: 8px; margin-top: 14px; }
.bid-form input { flex: 1; font-size: 1.1rem; font-weight: 600; }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick button { flex: 1; }
.leading { background: #e3f5ec; color: var(--ok); padding: 10px; border-radius: 8px; font-weight: 600; text-align: center; margin-top: 12px; }
.specs { width: 100%; border-collapse: collapse; }
.specs td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.specs td:first-child { color: var(--muted); width: 40%; }

/* tables */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list th { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: #fafafc; }
table.list tr:last-child td { border-bottom: 0; }
.thumb-sm { width: 64px; height: 42px; object-fit: cover; border-radius: 6px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .v { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.stat-card .k { color: var(--muted); font-size: .85rem; }
.stat-card.highlight { border-color: var(--gold); background: #fffaf0; }

.footer { background: var(--navy); color: #b9b9cc; font-size: .85rem; padding: 20px 0; }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a { color: var(--gold); }
