:root {
  --ink: #121315;
  --muted: #6d7077;
  --soft: #f3f3f1;
  --line: #e5e4e1;
  --white: #fff;
  --red: #e32636;
  --red-dark: #bd1524;
  --green: #16884a;
  --amber: #b66a04;
  --shadow: 0 18px 50px rgba(22, 22, 24, .09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f7f7f5;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #f7f7f5; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.topbar {
  height: 76px; padding: 0 max(20px, calc((100vw - 1280px) / 2));
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: var(--red); color: #fff; font-weight: 900; font-size: 22px; transform: skew(-5deg); }
.brand > span:last-child { display: grid; line-height: 1.03; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .13em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.connection-pill, .status-chip { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 8px 12px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.connection-pill { display: flex; align-items: center; gap: 7px; }
.connection-pill i, .live-note i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); display: inline-block; }
.connection-pill.online i, .live-note i { background: var(--green); box-shadow: 0 0 0 4px rgba(22,136,74,.1); }
.icon-button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 21px; transition: .2s; }
.icon-button:hover { transform: rotate(45deg); border-color: #bbb; }

main { max-width: 1280px; margin: 0 auto; padding: 0 20px 70px; }
.hero { margin: 28px 0 18px; min-height: 240px; padding: 42px 44px; display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; color: #fff; border-radius: 28px; overflow: hidden; position: relative; background: radial-gradient(circle at 80% 15%, #4b4e55 0, #222429 30%, #101114 68%); }
.hero::after { content: ""; position: absolute; width: 430px; height: 430px; right: -120px; top: -225px; border: 75px solid rgba(255,255,255,.055); border-radius: 50%; }
.hero-copy, .hero-stats { position: relative; z-index: 1; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.hero h1 { max-width: 690px; font-size: clamp(32px, 4.8vw, 60px); line-height: .98; letter-spacing: -.055em; margin: 15px 0 16px; }
.hero p { max-width: 600px; margin: 0; color: #bfc1c6; font-size: 17px; line-height: 1.5; }
.hero-stats { display: flex; gap: 9px; }
.hero-stats div { width: 112px; min-height: 92px; padding: 18px; border-radius: 17px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(10px); }
.hero-stats strong { display: block; font-size: 25px; letter-spacing: -.04em; }
.hero-stats span { color: #bfc1c6; font-size: 11px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tab { padding: 15px 18px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; }
.tab.active { color: var(--ink); border-bottom-color: var(--red); }
.badge { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 6px; padding: 0 5px; border-radius: 10px; background: #ececea; font-size: 11px; }
.tab.active .badge { background: #ffe8ea; color: var(--red); }
.view { display: none; }
.view.active { display: block; }

.participant-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 17px; background: #fff; margin-bottom: 16px; }
.participant-copy { display: flex; gap: 10px; align-items: center; min-width: 0; }
.label { color: var(--muted); font-size: 13px; }
.participant-copy select { appearance: none; border: 0; background: transparent; font-weight: 800; outline: 0; min-width: 215px; color: var(--ink); }
.status-chip.verified { color: var(--green); background: #eaf8f0; border-color: #ccebd9; }
.status-chip.pending { color: var(--amber); background: #fff7e7; border-color: #f3deb4; }
.status-chip.rejected { color: var(--red); background: #fff0f1; border-color: #f3ced2; }
.secondary-button, .primary-button { border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 800; transition: .2s; }
.secondary-button { color: var(--ink); background: var(--soft); }
.secondary-button:hover { background: #e8e8e5; }
.primary-button { color: #fff; background: var(--red); box-shadow: 0 8px 18px rgba(227,38,54,.2); }
.primary-button:hover { background: var(--red-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.wide { width: 100%; padding: 14px 18px; }

.catalog-toolbar { display: flex; gap: 12px; align-items: center; margin: 16px 0; }
.search-field { min-width: 270px; height: 46px; display: flex; align-items: center; gap: 8px; border-radius: 13px; border: 1px solid var(--line); background: #fff; padding: 0 13px; }
.search-field span { color: var(--muted); font-size: 22px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.city-scroller { display: flex; gap: 7px; overflow-x: auto; padding: 3px 1px; scrollbar-width: none; }
.city-scroller::-webkit-scrollbar { display: none; }
.city-chip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: #fff; color: #484b50; font-size: 13px; font-weight: 700; }
.city-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.catalog-meta { display: flex; justify-content: space-between; align-items: center; margin: 16px 1px 12px; color: var(--muted); font-size: 13px; }
.catalog-meta p { margin: 0; }
.live-note { display: flex; align-items: center; gap: 8px; }

.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.car-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 19px; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.01); transition: transform .22s, box-shadow .22s; }
.car-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.car-photo { aspect-ratio: 16/9.5; position: relative; overflow: hidden; background: linear-gradient(145deg,#e9e9e6,#d8d8d4); }
.car-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s; }
.car-card:hover img { transform: scale(1.025); }
.car-photo.no-image img { display: none; }
.car-photo.no-image::after { content: "А"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 62px; font-weight: 900; color: rgba(0,0,0,.12); }
.city-tag, .lot-tag { position: absolute; top: 12px; padding: 7px 9px; border-radius: 9px; font-size: 11px; font-weight: 800; backdrop-filter: blur(10px); }
.city-tag { left: 12px; color: #fff; background: rgba(17,18,20,.72); }
.lot-tag { right: 12px; color: var(--red); background: rgba(255,255,255,.9); }
.car-body { padding: 17px; display: flex; flex-direction: column; flex: 1; }
.car-title-row { display: flex; justify-content: space-between; gap: 12px; }
.car-title { font-size: 18px; line-height: 1.15; margin: 0; letter-spacing: -.025em; }
.year { font-size: 14px; font-weight: 800; color: var(--muted); }
.specs { min-height: 38px; margin: 8px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.auction-box { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.price-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.price { display: block; margin: 5px 0 10px; font-size: 25px; letter-spacing: -.045em; }
.lot-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; margin-bottom: 13px; }
.lot-meta .leading { color: var(--green); font-weight: 800; }
.bid-button { width: 100%; border: 0; border-radius: 11px; padding: 12px; background: var(--ink); color: #fff; font-weight: 800; transition: .2s; }
.bid-button:hover:not(:disabled) { background: var(--red); }
.bid-button:disabled { cursor: not-allowed; background: #d2d2cf; color: #74767b; }
.source-link { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 11px; text-decoration: none; }
.source-link:hover { color: var(--red); }
.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty-state > span { font-size: 40px; }
.empty-state h2 { color: var(--ink); margin-bottom: 4px; }
.skeleton { min-height: 410px; background: linear-gradient(100deg,#fff 20%,#f0f0ed 35%,#fff 50%); background-size: 300% 100%; animation: shine 1.2s infinite; }
@keyframes shine { to { background-position-x: -150%; } }

.admin-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 28px 0 20px; }
.admin-heading h2 { margin: 7px 0; font-size: 32px; letter-spacing: -.04em; }
.admin-heading p { margin: 0; color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.summary-item { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.summary-item strong { display: block; font-size: 27px; margin-bottom: 4px; }
.summary-item span { color: var(--muted); font-size: 12px; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.admin-card-head { padding: 18px 20px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.admin-card-head h3 { margin: 0; }
.admin-card-head span { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:last-child td { border: 0; }
.table-actions { display: flex; justify-content: flex-end; gap: 6px; }
.mini-button { border: 0; border-radius: 8px; padding: 7px 10px; font-size: 11px; font-weight: 800; }
.mini-button.accept { color: var(--green); background: #eaf8f0; }
.mini-button.reject { color: var(--red); background: #fff0f1; }

.dialog { width: min(520px, calc(100% - 28px)); border: 0; border-radius: 23px; padding: 0; box-shadow: 0 35px 100px rgba(0,0,0,.28); }
.dialog::backdrop { background: rgba(10,10,12,.56); backdrop-filter: blur(4px); }
.dialog form, .dialog > div { padding: 30px; position: relative; }
.dialog h2 { margin: 8px 0; font-size: 28px; letter-spacing: -.04em; }
.dialog-lead, .dialog p { color: var(--muted); line-height: 1.5; }
.dialog-close { position: absolute; right: 18px; top: 16px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--soft); font-size: 22px; }
.dialog label { display: grid; gap: 6px; margin: 14px 0; font-size: 12px; font-weight: 800; }
.dialog input, .dialog select { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px; outline: 0; background: #fff; }
.dialog input:focus, .dialog select:focus { border-color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog small { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; text-align: center; }
.bid-change { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 24px 0; padding: 20px; border-radius: 15px; background: var(--soft); }
.bid-change span { color: var(--muted); text-decoration: line-through; }
.bid-change b { color: var(--muted); }
.bid-change strong { color: var(--red); font-size: 23px; text-align: right; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 14px 17px; border-radius: 12px; color: #fff; background: var(--ink); box-shadow: var(--shadow); animation: toast-in .25s ease both; font-size: 13px; }
.toast.error { background: #a81f2a; }
.toast.success { background: #116f3d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 960px) {
  .hero { align-items: flex-start; flex-direction: column; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 0; width: 100%; }
}
@media (max-width: 620px) {
  .topbar { height: 66px; padding: 0 14px; }
  .connection-pill span { display: none; }
  .connection-pill { padding: 9px; }
  main { padding: 0 12px 50px; }
  .hero { margin-top: 12px; min-height: 290px; padding: 28px 22px 22px; border-radius: 21px; }
  .hero h1 { font-size: 37px; }
  .hero p { font-size: 14px; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1; width: auto; min-width: 0; padding: 13px; }
  .hero-stats strong { font-size: 20px; }
  .tabs { overflow-x: auto; }
  .tab { flex: 0 0 auto; padding: 13px 11px; font-size: 13px; }
  .participant-panel { align-items: stretch; flex-direction: column; }
  .participant-copy { flex-wrap: wrap; }
  .participant-copy select { width: 100%; min-width: 0; order: 3; }
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-meta { align-items: flex-start; flex-direction: column; gap: 7px; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .dialog form, .dialog > div { padding: 26px 20px; }
  .toast-stack { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}
