/* ── Admin Layout ────────────────────────────────────────────────────────────── */
.admin-main {
  padding: calc(var(--nav-h) + 2rem) 2rem 4rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* Login */
.admin-login-wrap {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.admin-login-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
}

/* Flash message */
.admin-flash {
  padding: .7rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  margin-bottom: 1.5rem;
}
.admin-flash.ok {
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.25);
  color: #4ade80;
}
.admin-flash.err {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  color: #f87171;
}

/* Stats */
.admin-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.admin-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  min-width: 100px;
  text-align: center;
}
.admin-stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: .25rem;
}
.admin-stat-label {
  font-size: .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Tabs */
.admin-tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
  overflow-x: auto;
}
.admin-tab {
  padding: .6rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
  margin-bottom: -1px;
}
.admin-tab:hover  { color: var(--text); }
.admin-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

/* Vehicle list */
.vehicle-list { display: flex; flex-direction: column; gap: .5rem; }
.vl-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s;
}
.vl-item.sold { opacity: .6; }
.vl-item:hover { border-color: #333; }
.vl-thumb {
  width: 80px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: var(--surface);
}
.vl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vl-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  color: var(--muted2);
}
.vl-sold-tag {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(239,68,68,.9);
  color: #fff;
  font-size: .55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.vl-info { flex: 1; min-width: 0; }
.vl-title {
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .25rem;
}
.vl-meta {
  display: flex;
  gap: .5rem;
  font-size: .75rem;
  color: var(--muted);
  align-items: center;
  flex-wrap: wrap;
}
.vl-price { font-size: .88rem; font-weight: 700; color: var(--blue); margin-top: .2rem; }
.vl-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.vl-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: border-color .2s, background .2s;
  text-decoration: none;
}
.vl-btn:hover { border-color: #444; background: #222; }
.vl-btn.danger:hover { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.1); }

/* Edit panel */
.edit-panel {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(59,130,246,.3);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: .5rem;
}

/* Form grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* Upload zone */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 8px;
  transition: border-color .2s;
  cursor: pointer;
}
.upload-zone:hover { border-color: var(--blue); }
.upload-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone-inner {
  padding: 2rem;
  text-align: center;
  pointer-events: none;
}
.upload-zone-inner p { font-size: .88rem; color: var(--muted); margin: .5rem 0 .25rem; }
.upload-zone-inner small { font-size: .75rem; color: var(--muted2); }
.file-input {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  padding: .5rem !important;
  cursor: pointer;
}

/* Photo previews */
.photo-preview-grid {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.preview-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Edit photos */
.edit-photos-grid {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.edit-photo-item {
  position: relative;
  width: 80px;
  height: 60px;
  flex-shrink: 0;
}
.edit-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}
.photo-del-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  color: #fff;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

/* Contacts */
.contacts-list { display: flex; flex-direction: column; gap: .75rem; }
.contact-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.contact-item.unread { border-color: rgba(59,130,246,.35); }
.contact-item-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .4rem;
}
.contact-item-header strong { font-size: .9rem; }
.contact-date { font-size: .75rem; color: var(--muted); margin-left: auto; }
.contact-new {
  font-size: .65rem;
  font-weight: 700;
  background: rgba(59,130,246,.15);
  color: var(--blue);
  padding: .15rem .5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.contact-vehicle { font-size: .8rem; color: var(--blue); margin-bottom: .3rem; }
.contact-contacts { display: flex; gap: 1rem; margin-bottom: .4rem; }
.contact-contacts a { font-size: .82rem; color: var(--muted); text-decoration: none; transition: color .2s; }
.contact-contacts a:hover { color: var(--text); }
.contact-msg {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.5;
  padding-top: .4rem;
  border-top: 1px solid var(--border-dim);
  margin-top: .4rem;
}
