@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --navy: #0f172a;
  --blue: #0f766e;
  --blue-light: #14b8a6;
  --orange: #f59e0b;
  --ink: #0f172a;
  --muted: #64748b;
  --bg: #f1f5f9;
  --line: #e2e8f0;
  --card: #ffffff;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 25px 60px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  line-height: 1.55;
}

/* ===== HEADER ===== */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(4%, calc((100% - 1200px) / 2));
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  color: #fff;
  gap: 20px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand {
  font-weight: 800;
  font-size: 22px;
  color: white;
  text-decoration: none;
  letter-spacing: -0.6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand span { color: var(--orange); }

.site-logo {
  height: 36px;
  width: auto;
  display: block;
}

nav {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  transition: all 0.2s;
}

nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-cta {
  background: linear-gradient(135deg, var(--orange), #fbbf24) !important;
  color: #1c1917 !important;
  border-radius: 10px;
  padding: 9px 16px !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

/* ===== BUTTONS ===== */
.btn {
  background: linear-gradient(135deg, var(--orange), #fbbf24);
  color: #1c1917 !important;
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.22s;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.4);
}

.btn-blue {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.3);
}

.btn-blue:hover {
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.4);
}

.btn-light {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
  border: 1.5px solid rgba(255,255,255,0.3);
  box-shadow: none;
}

.btn-light:hover {
  background: rgba(255,255,255,0.25) !important;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  line-height: 1.2;
}


.danger {
  background: #fee2e2 !important;
  color: #991b1b !important;
  box-shadow: none;
}

/* ===== LAYOUT ===== */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 48px;
  min-height: 70vh;
}

/* ===== HERO ===== */
.market-hero {
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 42%, #14b8a6 100%);
  color: #fff;
  border-radius: 0 0 28px 28px;
  padding: 48px max(4%, calc((100% - 1200px) / 2)) 72px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin: 0 calc(-1 * max(4%, calc((100% - 1200px) / 2))) 0;
  width: calc(100% + 2 * max(4%, calc((100% - 1200px) / 2)));
}

.market-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -12%;
  width: 55%;
  height: 140%;
  background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 65%);
  pointer-events: none;
}

.market-hero::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -8%;
  width: 35%;
  height: 55%;
  background: radial-gradient(circle, rgba(245,158,11,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-copy .pill {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.hero-copy h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-copy h1 span {
  background: linear-gradient(90deg, #fde68a, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-copy p {
  color: rgba(255,255,255,0.92);
  font-size: 16px;
  max-width: 440px;
  margin: 0 0 20px;
  line-height: 1.6;
}

.trust-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.trust-points span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.hero-photo {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  background: #0f172a;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.hero-photo:hover img {
  transform: scale(1.05);
}

.hero-car { height: 220px; }
.hero-truck { height: 220px; margin-top: 28px; }

.hero-photo figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 8px;
}

/* ===== SEARCH ===== */
.marketplace-search {
  max-width: 960px;
  margin: -48px auto 40px;
  padding: 22px 26px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 5;
}

.search-form { margin: 0; }

.search-main {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.search-keyword {
  flex: 1;
  min-width: 200px;
  margin: 0;
}

.search-keyword label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
  color: var(--ink);
}

.search-keyword input {
  width: 100%;
  height: 52px;
  font-size: 15px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  padding: 0 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-keyword input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.search-submit,
.filter-toggle {
  height: 52px;
  padding: 0 22px;
  font-size: 14px;
  border-radius: 12px;
  white-space: nowrap;
}

.filter-toggle {
  background: #f1f5f9 !important;
  color: var(--ink) !important;
  border: 1.5px solid var(--line);
  box-shadow: none;
}

.filter-toggle:hover {
  border-color: var(--blue);
  color: var(--blue) !important;
  background: rgba(15, 118, 110, 0.06) !important;
}

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.advanced-filters .field { margin: 0; }

.advanced-filters label {
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 5px;
  display: block;
}

.advanced-filters select,
.advanced-filters input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}

.advanced-filters select:focus,
.advanced-filters input:focus {
  border-color: var(--blue);
}

/* ===== CATEGORIES ===== */
.market-categories {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin: 0 0 48px;
}

.category-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 12px 18px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 148px;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.category-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  opacity: 0;
  transition: opacity 0.25s;
}

.category-tile:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.category-tile:hover::before { opacity: 1; }

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15,118,110,0.1), rgba(20,184,166,0.16));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--blue);
  transition: transform 0.3s;
}

.category-tile:hover .category-icon { transform: scale(1.08); }

.category-tile strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.category-tile small {
  font-size: 12px;
  color: var(--muted);
}

/* ===== VEHICLE GRID ===== */
#vehicles { margin: 0 0 20px; }

#vehicles h2 {
  font-size: 26px;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-mark {
  display: inline-block;
  width: 5px;
  height: 26px;
  background: linear-gradient(180deg, var(--blue), var(--blue-light));
  border-radius: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.vehicle {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.vehicle:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.vehicle img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #e2e8f0;
  transition: transform 0.4s ease;
}

.vehicle:hover img { transform: scale(1.04); }

.vehicle-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.vehicle h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.price {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
}

.muted { color: var(--muted); font-size: 13px; }

.pill {
  display: inline-block;
  background: rgba(15, 118, 110, 0.1);
  color: var(--blue);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.between { justify-content: space-between; }

/* ===== PANELS / FORMS ===== */
.panel, .form-card, .filters {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  margin: 0;
}

.empty-state .category-icon { margin: 0 auto 16px; }
.empty-state h3 { margin: 0 0 8px; font-size: 20px; }
.empty-state p { margin: 0 0 24px; font-size: 14px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.field label { font-size: 13px; font-weight: 700; }

.field input, .field select, .field textarea,
input, select, textarea {
  font: inherit;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

/* ===== FLASH ===== */
.flash {
  padding: 14px 18px;
  border-radius: 12px;
  margin: 16px 0;
  font-weight: 600;
  font-size: 14px;
}

.flash.info { background: #e0f2fe; color: #0369a1; }
.flash.success { background: #d1fae5; color: #065f46; }
.flash.error { background: #fee2e2; color: #991b1b; }

/* ===== TABLES / ADMIN ===== */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
}

/* Admin user edit panel — one-line rows + eye password */
.admin-edit-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
  max-width: 960px;
}
.admin-user-form .field {
  margin: 0;
  gap: 4px;
  display: flex;
  flex-direction: column;
}
.admin-user-form .field label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.admin-user-form input[type="text"],
.admin-user-form input[type="email"],
.admin-user-form input[type="password"],
.admin-user-form input[type="tel"],
.admin-user-form input:not([type]),
.admin-user-form select {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 6px 10px !important;
  box-sizing: border-box;
  width: 100%;
  line-height: 1.3;
  border-radius: 8px;
  font-size: 0.92rem;
}
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap input {
  padding-right: 40px !important;
  width: 100%;
}
.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  line-height: 0;
}
.pw-eye:hover { color: #0d2650; background: #e2e8f0; }
.user-edit-row td { vertical-align: top; }
.admin-users-table th,
.admin-users-table td {
  vertical-align: middle;
  padding: 10px 12px;
  font-size: 0.92rem;
}
.admin-users-table th {
  white-space: nowrap;
  background: #f1f5f9;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #475569;
}
@media (max-width: 900px) {
  .admin-edit-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .admin-edit-row { grid-template-columns: 1fr; }
}



table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { background: #f8fafc; white-space: nowrap; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stat strong {
  display: block;
  font-size: 26px;
  color: var(--blue);
}

.detail {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.detail img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 16px;
  background: #e2e8f0;
}

/* ===== FOOTER ===== */
footer {
  background: var(--navy);
  color: #94a3b8;
  text-align: center;
  padding: 28px 20px;
  font-size: 13.5px;
  margin-top: 24px;
}

/* ===== ICONS ===== */
.ic {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.category-icon .ic {
  width: 26px;
  height: 26px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
  .market-categories { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .market-hero {
    grid-template-columns: 1fr;
    padding: 36px 24px 64px;
    gap: 28px;
    margin-left: -20px;
    margin-right: -20px;
    width: calc(100% + 40px);
    border-radius: 0 0 24px 24px;
  }
  .hero-photos { max-width: 480px; }
  .hero-truck { margin-top: 20px; }
  .marketplace-search { margin: -40px 0 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .market-categories {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 36px;
  }
  .category-tile { min-height: 130px; padding: 16px 8px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .hero-copy h1 { font-size: 28px; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .search-main { flex-direction: column; align-items: stretch; }
  .search-submit, .filter-toggle { width: 100%; justify-content: center; }
  #vehicles h2 { font-size: 22px; }
  .hero-car, .hero-truck { height: 160px; }
  .hero-truck { margin-top: 12px; }
  .form-grid, .detail { grid-template-columns: 1fr; }
  .top { padding: 12px 16px; }
}

@media (min-width: 901px) {
  .market-hero { gap: 36px; }
}
