* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #f4f6f8;
  color: #1a1a1a;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  background: #ffffff;
  border-bottom: 1px solid #e1e4e8;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.logo span {
  color: #2563eb;
}

.nav-links a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #475569;
  font-weight: 500;
}

.nav-links .dealer-link {
  background: #2563eb;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
}

.hero-section {
  text-align: center;
  padding: 4rem 1rem 3rem;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.hero-section h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  max-width: 800px;
  margin: 2rem auto 0;
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.field {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 160px;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.3rem;
}

.field select, .field input {
  padding: 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
}

.btn-search {
  align-self: flex-end;
  padding: 0.7rem 1.8rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.car-card {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.car-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.car-card-content {
  padding: 1.25rem;
  flex-grow: 1;
}

.deal-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.deal-great { background: #dcfce7; color: #15803d; }
.deal-good { background: #e0f2fe; color: #0369a1; }
.deal-fair { background: #f1f5f9; color: #475569; }
.deal-high { background: #fee2e2; color: #b91c1c; }

.car-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0.4rem 0;
}

.btn-contact {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* --- New rules added for the dealer dashboard --- */

.dashboard-box {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.dashboard-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-form .btn-search {
  align-self: stretch;
}

.status-message {
  color: #dc2626;
  font-size: 0.9rem;
  min-height: 1.2rem;
}

.btn-cancel {
  padding: 0.7rem 1.8rem;
  background: #e2e8f0;
  color: #334155;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-edit, .btn-delete {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.btn-edit {
  background: #e0f2fe;
  color: #0369a1;
}

.btn-delete {
  background: #fee2e2;
  color: #b91c1c;
}

/* --- Contact Dealer modal --- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-box {
  background: #ffffff;
  border-radius: 10px;
  padding: 1.75rem;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.btn-contact-dealer {
  width: 100%;
  margin-top: 1rem;
  padding: 0.65rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* --- Dealer inquiry inbox --- */

.inquiry-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.inquiry-card.unread {
  border-left: 4px solid #2563eb;
  background: #f8fafc;
}

.inquiry-card .inquiry-meta {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.4rem;
}

.inquiry-card .inquiry-message {
  margin: 0.5rem 0;
}